From 4e2a2d3f285838e51921c68a69300a1c58c7fcdf Mon Sep 17 00:00:00 2001 From: Michal Rudowicz Date: Wed, 12 Jun 2024 23:14:15 +0200 Subject: [PATCH] Added missing await --- autobanbot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autobanbot.py b/autobanbot.py index feece93..0c0a6ac 100755 --- a/autobanbot.py +++ b/autobanbot.py @@ -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)