mercatus/Utils.py
cupcakearmy 54595d9e54 source
2019-06-12 21:31:06 +02:00

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