From fae934d0b9a57d4586a797f057cc0d2a0c2ce0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CA=99=E1=B4=80=E1=B4=85=20=E1=B4=8D=E1=B4=9C=C9=B4?= =?UTF-8?q?=E1=B4=85=E1=B4=80=20=F0=9F=8C=B8?= <154504921+Badhacker98@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:07:35 +0530 Subject: [PATCH] Update mongo.py --- shizuchat/modules/helpers/mongo.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shizuchat/modules/helpers/mongo.py b/shizuchat/modules/helpers/mongo.py index f815eca..bcc20f5 100644 --- a/shizuchat/modules/helpers/mongo.py +++ b/shizuchat/modules/helpers/mongo.py @@ -84,6 +84,14 @@ async def group_on(): if not user: return await modedb.insert_one({"chat_id": chat_id}) + def get_file_id(msg: Message): + if not msg.media: return None + for message_type in ("photo", "animation", "audio", "document", "video", "video_note", "voice", "sticker"): + obj = getattr(msg, message_type) + if obj: + setattr(obj, "message_type", message_type) + return obj + async def group_off(): chat_id = 123 modelist[chat_id] = False