diff --git a/src/bot.py b/src/bot.py index 8afea39..284c42f 100644 --- a/src/bot.py +++ b/src/bot.py @@ -37,6 +37,13 @@ if __name__ == '__main__': # Register commands dispatcher.add_handler(CommandHandler('start', start)) dispatcher.add_handler(CommandHandler('ls', ls)) + dispatcher.add_handler(CommandHandler('touch', touch)) + dispatcher.add_handler(CommandHandler('rm', rm)) + dispatcher.add_handler(CommandHandler('mv', mv)) + dispatcher.add_handler(CommandHandler('nano', nano)) + dispatcher.add_handler(CommandHandler('interval', interval)) + dispatcher.add_handler(CommandHandler('enable', enable)) + dispatcher.add_handler(CommandHandler('disable', disable)) # Start bot updater.start_polling() diff --git a/src/commands.md b/src/commands.md index 511f916..7f65cc1 100644 --- a/src/commands.md +++ b/src/commands.md @@ -6,4 +6,4 @@ mv - Rename a http request nano - Edit a http request interval - Change the interval between the updates of a http request enable - Start listening to a http request -stop - Stop listening to a http request +disable - Stop listening to a http request diff --git a/src/commands.py b/src/commands.py index 0230afd..37c6dc8 100644 --- a/src/commands.py +++ b/src/commands.py @@ -18,7 +18,7 @@ Welcome! This bot monitors http changes! *Start/Stop Commands* /enable - Start listening to a http request -/stop - Stop listening to a http request +/disable - Stop listening to a http request """ @@ -37,3 +37,38 @@ def ls(update, context): requests = database.userRequests[chat.id] context.bot.send_message(chat_id=update.effective_chat.id, text="Your requests: " + toJson(requests)) + + +def touch(update, context): + chat = update.effective_chat + database.checkUser(chat.id) + + +def rm(update, context): + chat = update.effective_chat + database.checkUser(chat.id) + + +def mv(update, context): + chat = update.effective_chat + database.checkUser(chat.id) + + +def nano(update, context): + chat = update.effective_chat + database.checkUser(chat.id) + + +def interval(update, context): + chat = update.effective_chat + database.checkUser(chat.id) + + +def enable(update, context): + chat = update.effective_chat + database.checkUser(chat.id) + + +def disable(update, context): + chat = update.effective_chat + database.checkUser(chat.id)