Add /time
This commit is contained in:
@@ -87,15 +87,16 @@ def message_handling(bot, update):
|
||||
data=params)
|
||||
|
||||
|
||||
def list_cmd(bot, update):
|
||||
def direct_cmd(bot, update, text):
|
||||
if update.message.chat.id in config.groups:
|
||||
params = {"message": "list"}
|
||||
params = {"message": text}
|
||||
requests.post("http://localhost:" + str(config.port) + "/post",
|
||||
data=params)
|
||||
|
||||
|
||||
updater = Updater(token=config.api_key)
|
||||
dispatcher = updater.dispatcher
|
||||
dispatcher.add_handler(CommandHandler('list', list_cmd))
|
||||
dispatcher.add_handler(CommandHandler('list', lambda x, y: direct_cmd(x, y, "list")))
|
||||
dispatcher.add_handler(CommandHandler('time', lambda x, y: direct_cmd(x, y, "time")))
|
||||
dispatcher.add_handler(MessageHandler(Filters.all, message_handling))
|
||||
updater.start_polling()
|
||||
|
||||
Reference in New Issue
Block a user