Undefined name detected # PYL-E0602

This commit is contained in:
yasirarism 2023-06-27 03:33:45 +00:00 committed by GitHub
parent a55824673b
commit 14530b58b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 7 deletions

View file

@ -40,7 +40,7 @@ MOD_NOLOAD = ["subscene_dl"]
HELPABLE = {} HELPABLE = {}
cleanmode = {} cleanmode = {}
botStartTime = time.time() botStartTime = time.time()
misskaty_version = "v2.9.1 - Stable" misskaty_version = "v2.9.2 - Stable"
# Pyrogram Bot Client # Pyrogram Bot Client
app = Client( app = Client(

View file

@ -1,6 +1,7 @@
import asyncio import asyncio, logging
from functools import wraps from functools import wraps
LOGGER = logging.getLogger(__name__)
def asyncify(func): def asyncify(func):
async def inner(*args, **kwargs): async def inner(*args, **kwargs):
@ -18,6 +19,6 @@ def new_task(func):
loop = asyncio.get_running_loop() loop = asyncio.get_running_loop()
return loop.create_task(func(*args, **kwargs)) return loop.create_task(func(*args, **kwargs))
except Exception as e: except Exception as e:
LOGGER.error(f"Failed to create task for {func.__name__} : {e}") LOGGER.error(f"Failed to create task for {func.__name__} : {e}") # skipcq: PYL-E0602
return wrapper return wrapper

View file

@ -854,7 +854,7 @@ async def set_chat_photo(self: Client, ctx: Message):
if file.file_size > 5000000: if file.file_size > 5000000:
return await ctx.reply("File size too large.") return await ctx.reply("File size too large.")
file = await reply.download() photo = await reply.download()
try: try:
await ctx.chat.set_photo(photo=photo) await ctx.chat.set_photo(photo=photo)
await ctx.reply_text("Successfully Changed Group Photo") await ctx.reply_text("Successfully Changed Group Photo")

View file

@ -1,5 +1,5 @@
from pyrogram import Client, filters from pyrogram import Client, filters
from pyrogram.errors import ChannelPrivate from pyrogram.errors import ChannelPrivate, PeerIdInvalid
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
from database.users_chats_db import db from database.users_chats_db import db

View file

@ -111,7 +111,7 @@ async def download(client, message):
try: try:
downloader.start(blocking=False) downloader.start(blocking=False)
except Exception as err: except Exception as err:
return await ctx.edit(str(err)) return await message.edit_msg(str(err))
c_time = time.time() c_time = time.time()
while not downloader.isFinished(): while not downloader.isFinished():
total_length = downloader.filesize or None total_length = downloader.filesize or None

View file

@ -77,7 +77,7 @@ async def inline_menu(_, inline_query: InlineQuery):
**MongoDB:** `{aspymon_ver}` **MongoDB:** `{aspymon_ver}`
**Platform:** `{platform}` **Platform:** `{platform}`
**Bot:** {(await app.get_me()).first_name} **Bot:** {(await app.get_me()).first_name}
""" """
if USER_SESSION: if USER_SESSION:
msg += f"**UserBot:** {(await user.get_me()).first_name}" msg += f"**UserBot:** {(await user.get_me()).first_name}"
answerss = [ answerss = [