Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def error(bot, update, error):
- try:
- logger.warn('Update "%s" caused error "%s"' % (update, error))
- raise error
- except Unauthorized:
- db = mysql.connector.connect(user='root', password='', host='localhost', database='ict_telegram')
- cursor = db.cursor(buffered=True)
- delete_user = ("DELETE FROM users WHERE chatid = '%s'" % (update.message.chat_id))
- cursor.execute(delete_user)
- db.commit()
- cursor.close()
- db.close()
- #except BadRequest:
- # handle malformed requests - read more below!
- #except TimedOut:
- # handle slow connection problems
- #except NetworkError:
- # handle other connection problems
- #except ChatMigrated as e:
- # the chat_id of a group has changed, use e.new_chat_id instead
- #except TelegramError:
- # handle all other telegram related errors
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement