mirror of
https://github.com/cupcakearmy/mercatus.git
synced 2024-11-01 08:14:10 +01:00
18 lines
462 B
Python
18 lines
462 B
Python
|
from telegram import Update
|
||
|
from telegram.ext import PicklePersistence
|
||
|
from yaml import load, Loader
|
||
|
from enum import Enum
|
||
|
|
||
|
config = load(open('./config.yml', 'r'), Loader=Loader)
|
||
|
persistence = PicklePersistence('./data/mercatus')
|
||
|
|
||
|
|
||
|
class Section(Enum):
|
||
|
Watchlist = 'watchlist'
|
||
|
API_Key = 'api_key'
|
||
|
|
||
|
|
||
|
def parse_command(update: Update) -> (str, str):
|
||
|
key, value = (update.message.text.split(' ', 1)[1].split(' ', 1) + [None])[:2]
|
||
|
return key, value
|