From 3e297573df760842f542573573d4030836052f97 Mon Sep 17 00:00:00 2001 From: yasirarism <55983182+yasirarism@users.noreply.github.com> Date: Mon, 29 May 2023 14:25:43 +0000 Subject: [PATCH] FOrget things --- misskaty/plugins/dev.py | 3 +++ misskaty/plugins/media_extractor.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/misskaty/plugins/dev.py b/misskaty/plugins/dev.py index ea0d2ef7..3098f612 100644 --- a/misskaty/plugins/dev.py +++ b/misskaty/plugins/dev.py @@ -12,6 +12,7 @@ import aiohttp from datetime import datetime from shutil import disk_usage from time import time +from database.users_chats_db import db from inspect import getfullargspec from typing import Any, Optional, Tuple @@ -313,6 +314,8 @@ async def update_restart(self: Client, ctx: Message, strings) -> "Message": async def updtebot(client, update, users, chats): if isinstance(update, UpdateBotStopped): user = users[update.user_id] + if update.stopped and await db.is_user_exist(user.id):: + await db.delete_user(user.id) await client.send_msg(LOG_CHANNEL, f"{user.first_name} ({user.id}) " f"{'BLOCKED' if update.stopped else 'UNBLOCKED'} the bot at " f"{datetime.fromtimestamp(update.date)}") async def aexec(code, c, m): diff --git a/misskaty/plugins/media_extractor.py b/misskaty/plugins/media_extractor.py index 8e91f807..a6a8214e 100644 --- a/misskaty/plugins/media_extractor.py +++ b/misskaty/plugins/media_extractor.py @@ -119,7 +119,7 @@ async def ceksub(self: Client, ctx: Message, strings): @use_chat_lang() async def convertsrt(self: Client, ctx: Message, strings): reply = ctx.reply_to_message - if replied and replied.document and (replied.document.file_name and replied.document.file_name.endswith(".vtt") or replied.document.file_name.endswith(".ass")): + if reply and reply.document and (reply.document.file_name and reply.document.file_name.endswith(".vtt") or reply.document.file_name.endswith(".ass")): msg = await ctx.reply_msg(strings("convert_str"), quote=True) if not os.path.exists("downloads"): os.makedirs("downloads")