[+] Create ls command

This commit is contained in:
Hykilpikonna
2020-11-22 13:15:57 -05:00
parent c7fca91d2d
commit 1466a4bfd3
3 changed files with 25 additions and 2 deletions
+7
View File
@@ -2,6 +2,13 @@
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JpaDataSourceORMInspection" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
</list>
</option>
</inspection_tool>
<inspection_tool class="SqlResolveInspection" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="UNCHECKED_WARNING" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnusedReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
+1
View File
@@ -36,6 +36,7 @@ if __name__ == '__main__':
# Register commands
dispatcher.add_handler(CommandHandler('start', start))
dispatcher.add_handler(CommandHandler('ls', ls))
# Start bot
updater.start_polling()
+17 -2
View File
@@ -1,4 +1,6 @@
# Help message
from src.bot import database
from src.utils import toJson
helpMsg = """
Welcome! This bot monitors http changes!
@@ -21,4 +23,17 @@ Welcome! This bot monitors http changes!
def start(update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text=helpMsg, parse_mode="markdown")
chat = update.effective_chat
database.checkUser(chat.id)
# Send help
context.bot.send_message(chat_id=chat.id, text=helpMsg, parse_mode="markdown")
def ls(update, context):
chat = update.effective_chat
database.checkUser(chat.id)
requests = database.userRequests[chat.id]
context.bot.send_message(chat_id=update.effective_chat.id, text="Your requests: " + toJson(requests))