diff --git a/misskaty/__main__.py b/misskaty/__main__.py index eab9f214..d33d06fd 100644 --- a/misskaty/__main__.py +++ b/misskaty/__main__.py @@ -60,6 +60,7 @@ async def start_bot(): ) except Exception as e: LOGGER.error(str(e)) + asyncio.create_task(auto_clean()) await idle() diff --git a/misskaty/plugins/afk.py b/misskaty/plugins/afk.py index 94748dc2..e9845974 100644 --- a/misskaty/plugins/afk.py +++ b/misskaty/plugins/afk.py @@ -79,7 +79,7 @@ async def active_afk(_, message): f"**{message.from_user.first_name}** is back online", disable_web_page_preview=True, ) - await put_cleanmode(message.chat.id, send.message_id) + await put_cleanmode(message.chat.id, send.id) return if len(message.command) == 1 and not message.reply_to_message: details = { @@ -179,7 +179,7 @@ async def active_afk(_, message): send = await message.reply_text( f"{message.from_user.mention} [{message.from_user.id}] is now AFK! This message will be deleted in 10s." ) - await put_cleanmode(message.chat.id, send.message_id) + await put_cleanmode(message.chat.id, send.id) @app.on_message(filters.command("afkdel") & ~filters.private) diff --git a/misskaty/plugins/detect_afk.py b/misskaty/plugins/detect_afk.py index 09ad538f..dcef4c87 100644 --- a/misskaty/plugins/detect_afk.py +++ b/misskaty/plugins/detect_afk.py @@ -228,6 +228,6 @@ async def chat_watcher_func(_, message): except: return try: - await put_cleanmode(message.chat.id, send.message_id) + await put_cleanmode(message.chat.id, send.id) except: return