FOrget things

This commit is contained in:
yasirarism 2023-05-29 14:25:43 +00:00 committed by GitHub
parent 375be9672c
commit 3e297573df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -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"<a href='tg://user?id={user.id}'>{user.first_name}</a> (<code>{user.id}</code>) " f"{'BLOCKED' if update.stopped else 'UNBLOCKED'} the bot at " f"{datetime.fromtimestamp(update.date)}")
async def aexec(code, c, m):

View file

@ -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")