From 4c570d009210b0009c41c7196425f0e0b8419947 Mon Sep 17 00:00:00 2001 From: thedragonsinn <98635854+thedragonsinn@users.noreply.github.com> Date: Sun, 4 May 2025 18:18:27 +0530 Subject: [PATCH] `kang:` fix egdecase and bot logic --- app/plugins/tg_tools/kang.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/plugins/tg_tools/kang.py b/app/plugins/tg_tools/kang.py index e18edba..a0d98c8 100644 --- a/app/plugins/tg_tools/kang.py +++ b/app/plugins/tg_tools/kang.py @@ -22,6 +22,8 @@ EMOJIS = ("☕", "🤡", "🙂", "🤔", "🔪", "😂", "💀") async def save_sticker(file: Path | BytesIO) -> str: + bot = getattr(bot, "bot", bot) + sent_file = await bot.send_document( chat_id=Config.LOG_CHAT, document=file, message_thread_id=Config.LOG_CHAT_THREAD_ID ) @@ -208,11 +210,7 @@ async def kang(bot: BOT, message: Message): response = await message.reply("Processing...") - _bot = getattr(bot, "bot", None) - - if _bot: - replied = await replied.log() - bot = _bot + bot = getattr(bot, "bot", bot) file_id, emoji = await media_func(message=replied, ff="-f" in message.flags)