Display logged messages.
This commit is contained in:
parent
01019f1186
commit
919dd9e940
10
bot.py
10
bot.py
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user