Added missing await

This commit is contained in:
Michał Rudowicz 2024-06-12 23:14:15 +02:00
parent 0197c70d80
commit 4e2a2d3f28
1 changed files with 3 additions and 2 deletions

View File

@ -24,8 +24,9 @@ async def new_msg(update, context, regexes):
break
if is_spam:
logging.info(f"Banning: {update.message}")
update.message.chat.ban_member(update.message.from_user.id)
update.message.delete()
await update.message.chat.ban_member(update.message.from_user.id)
await update.message.delete()
logging.info("Banned.")
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s|%(levelname)s|%(message)s', level=logging.INFO)