Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You can only find out what he deleted when the bot sends a message and receives an execut that he was deleted.
You need to catch the exception and call the deletion from the database.
try:
bot.send_message(user_id, text)
except telebot.apihelper.ApiException:
logging.exception(f'Send Notification ERROR - {telebot.apihelper.ApiException}')
delete_user(user_id)
def delete_user(user_id):
del_user_query = f'DELETE FROM {users_t} WHERE {users_col["user_id"]} = {user_id};'
post_sql_query(del_user_query)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question