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)