From 845c1a9e42530b265d3b5143f4db3cd4fce6f22a Mon Sep 17 00:00:00 2001 From: Abhi <85984486+AbhiTheModder@users.noreply.github.com> Date: Tue, 29 Apr 2025 15:21:29 +0530 Subject: [PATCH] Update antipm.py --- modules/antipm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/antipm.py b/modules/antipm.py index 3ff7a6b..9ce1b23 100644 --- a/modules/antipm.py +++ b/modules/antipm.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import os + from pyrogram import Client, filters from pyrogram.raw import functions from pyrogram.types import Message @@ -76,7 +78,7 @@ Do not spam further messages else I may have to block you! "core.antipm", f"allowusers{ids}" ): default_pic = db.get("core.antipm", "antipm_pic", None) - if default_pic: + if default_pic and os.path.exists(default_pic): await client.send_photo(message.chat.id, default_pic, caption=default_text) else: await client.send_message(message.chat.id, default_text) @@ -232,7 +234,7 @@ async def set_antipm_pic(_, message: Message): await message.edit("Setting antipm picture...") - photo = await message.reply_to_message.download("./antipm_pic.jpg") + photo = await message.reply_to_message.download("antipm_pic.jpg") old_antipm_pic = db.get("core.antipm", "antipm_pic", None) if old_antipm_pic: