chore: fbans notify on failed user extraction | drop deprecated method in zombies.

This commit is contained in:
thedragonsinn
2024-11-05 15:18:36 +05:30
parent 4d6057d856
commit 61742743d6
2 changed files with 4 additions and 2 deletions

View File

@@ -96,6 +96,7 @@ async def fed_ban(bot: BOT, message: Message):
progress: Message = await message.reply("")
extracted_info = await get_user_reason(message=message, progress=progress)
if not extracted_info:
await progress.edit("Unable to extract user info.")
return
user_id, user_mention, reason = extracted_info
@@ -144,6 +145,7 @@ async def un_fban(bot: BOT, message: Message):
extracted_info = await get_user_reason(message=message, progress=progress)
if not extracted_info:
await progress.edit("Unable to extract user info.")
return
user_id, user_mention, reason = extracted_info

View File

@@ -1,5 +1,5 @@
import asyncio
from datetime import datetime, timedelta
from datetime import UTC, datetime, timedelta
from pyrogram.enums import ChatMemberStatus
from pyrogram.errors import FloodWait
@@ -34,7 +34,7 @@ async def clean_zombies(bot: BOT, message: Message):
await bot.ban_chat_member(
chat_id=message.chat.id,
user_id=member.user.id,
until_date=datetime.utcnow() + timedelta(seconds=60),
until_date=datetime.now(UTC) + timedelta(seconds=60),
)
await asyncio.sleep(1)