[+] Create other commands
This commit is contained in:
@@ -37,6 +37,13 @@ if __name__ == '__main__':
|
|||||||
# Register commands
|
# Register commands
|
||||||
dispatcher.add_handler(CommandHandler('start', start))
|
dispatcher.add_handler(CommandHandler('start', start))
|
||||||
dispatcher.add_handler(CommandHandler('ls', ls))
|
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
|
# Start bot
|
||||||
updater.start_polling()
|
updater.start_polling()
|
||||||
|
|||||||
+1
-1
@@ -6,4 +6,4 @@ mv - Rename a http request
|
|||||||
nano - Edit a http request
|
nano - Edit a http request
|
||||||
interval - Change the interval between the updates of a http request
|
interval - Change the interval between the updates of a http request
|
||||||
enable - Start listening to a http request
|
enable - Start listening to a http request
|
||||||
stop - Stop listening to a http request
|
disable - Stop listening to a http request
|
||||||
|
|||||||
+36
-1
@@ -18,7 +18,7 @@ Welcome! This bot monitors http changes!
|
|||||||
|
|
||||||
*Start/Stop Commands*
|
*Start/Stop Commands*
|
||||||
/enable - Start listening to a http request
|
/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]
|
requests = database.userRequests[chat.id]
|
||||||
|
|
||||||
context.bot.send_message(chat_id=update.effective_chat.id, text="Your requests: " + toJson(requests))
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user