diff --git a/src/commands.py b/src/commands.py index 37c6dc8..dcb3f6d 100644 --- a/src/commands.py +++ b/src/commands.py @@ -26,17 +26,15 @@ def start(update, context): chat = update.effective_chat database.checkUser(chat.id) - # Send help - context.bot.send_message(chat_id=chat.id, text=helpMsg, parse_mode="markdown") + return helpMsg 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)) + return "Your requests: " + toJson(requests) def touch(update, context): diff --git a/src/utils.py b/src/utils.py index 950cf94..54d8a21 100644 --- a/src/utils.py +++ b/src/utils.py @@ -17,8 +17,8 @@ def createCommand(method): data = method(update, context) # Send back data if not null - if data is not None and data is not '': - context.bot.send_message(chat_id=update.effective_chat.id, text=data) + if data is not None and data != '': + context.bot.send_message(chat_id=update.effective_chat.id, text=data, parse_mode="markdown") # Create handler for the wrapper command return CommandHandler(method.__name__, command, run_async=True)