It can be usefull to add possibility to ban any user in bot. I realized my own solution with additional field "banned" in mongo database. And simple part of my code. But it can be not the best solution.
async def message_handle(update: Update, context: CallbackContext, message=None, use_new_dialog_timeout=True):
#check is banned
user_id = update.message.from_user.id
isbanned = db.get_user_attribute(user_id, "banned")
if isbanned == 1:
await update.message.reply_text("You are banned!")
return
It can be usefull to add possibility to ban any user in bot. I realized my own solution with additional field "banned" in mongo database. And simple part of my code. But it can be not the best solution.