From 919dd9e94036d21a55bba159d23f1e013335fcae Mon Sep 17 00:00:00 2001 From: Stan James Date: Sun, 28 Jan 2018 22:41:12 -0700 Subject: [PATCH] Display logged messages. --- bot.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 463aa02..59a42a3 100644 --- a/bot.py +++ b/bot.py @@ -30,16 +30,16 @@ def logger(bot, update): if id_exists(user.id) == True: log_message(user.id, update.message.text) - print("message logged") - else: add_user_success = add_user(user.id, user.first_name, user.last_name, user.username) if add_user_success == True: log_message(user.id, update.message.text) - print("user added & message logged") + print("User added") else: - print("Something went wrong adding the user!") + print("Something went wrong adding the user {}".format(user.id)) + + print("{} : {}".format(user.username,update.message.text)) # DB queries @@ -110,6 +110,8 @@ def main(): # Start the Bot updater.start_polling() + print("Bot started") + # Run the bot until you press Ctrl-C or the process receives SIGINT, # SIGTERM or SIGABRT. This should be used most of the time, since # start_polling() is non-blocking and will stop the bot gracefully.