Display logged messages.

This commit is contained in:
Stan James 2018-01-28 22:41:12 -07:00
parent 01019f1186
commit 919dd9e940

10
bot.py
View File

@ -30,16 +30,16 @@ def logger(bot, update):
if id_exists(user.id) == True: if id_exists(user.id) == True:
log_message(user.id, update.message.text) log_message(user.id, update.message.text)
print("message logged")
else: else:
add_user_success = add_user(user.id, user.first_name, user.last_name, user.username) add_user_success = add_user(user.id, user.first_name, user.last_name, user.username)
if add_user_success == True: if add_user_success == True:
log_message(user.id, update.message.text) log_message(user.id, update.message.text)
print("user added & message logged") print("User added")
else: 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 # DB queries
@ -110,6 +110,8 @@ def main():
# Start the Bot # Start the Bot
updater.start_polling() updater.start_polling()
print("Bot started")
# Run the bot until you press Ctrl-C or the process receives SIGINT, # 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 # SIGTERM or SIGABRT. This should be used most of the time, since
# start_polling() is non-blocking and will stop the bot gracefully. # start_polling() is non-blocking and will stop the bot gracefully.