mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-02 02:44:50 +00:00
fix
This commit is contained in:
parent
bafee5a7cd
commit
44c59927be
2 changed files with 4 additions and 3 deletions
|
|
@ -12,6 +12,7 @@ def command(
|
|||
group_only: typing.Union[bool, bool] = False,
|
||||
self_admin: typing.Union[bool, bool] = False,
|
||||
self_only: typing.Union[bool, bool] = False,
|
||||
no_channel: typing.Union[bool, bool] = False,
|
||||
handler: typing.Optional[list] = None,
|
||||
filter: typing.Union[pyrogram.filters.Filter, pyrogram.filters.Filter] = None,
|
||||
*args,
|
||||
|
|
@ -80,6 +81,8 @@ def command(
|
|||
async def decorator(client, message: pyrogram.types.Message):
|
||||
if is_disabled:
|
||||
return await message.reply_text("Sorry, this command has been disabled by owner.")
|
||||
if no_channel:
|
||||
return await message.reply_text("I'm cannot identify user. Use my command in private chat.")
|
||||
if (
|
||||
self_admin
|
||||
and message.chat.type != pyrogram.enums.ChatType.SUPERGROUP
|
||||
|
|
|
|||
|
|
@ -35,13 +35,11 @@ def rand_key():
|
|||
return str(uuid4())[:8]
|
||||
|
||||
|
||||
@app.on_cmd("ytsearch", filter=~filters.channel)
|
||||
@app.on_cmd("ytsearch", no_channel=True)
|
||||
@capture_err
|
||||
@ratelimiter
|
||||
@use_chat_lang()
|
||||
async def ytsearch(self: Client, ctx: Message, strings):
|
||||
if ctx.sender_chat:
|
||||
return await ctx.reply_msg(strings("no_channel"))
|
||||
if len(ctx.command) == 1:
|
||||
return await ctx.reply_msg(strings("no_query"))
|
||||
query = ctx.text.split(" ", maxsplit=1)[1]
|
||||
|
|
|
|||
Loading…
Reference in a new issue