mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
Tes fix perm for channel
Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
parent
8d9e111c04
commit
49f7ea6835
2 changed files with 6 additions and 5 deletions
|
|
@ -116,6 +116,7 @@ def adminsOnly(
|
|||
self,
|
||||
permission: typing.Union[str, list],
|
||||
TRUST_ANON_ADMINS: typing.Union[bool, bool] = False,
|
||||
ALLOW_CHANNEL: typing.Union[bool, bool] = False,
|
||||
):
|
||||
"""
|
||||
# `tgEasy.tgClient.adminsOnly`
|
||||
|
|
@ -148,7 +149,7 @@ def adminsOnly(
|
|||
return await message.reply_text(
|
||||
"This command can be used in supergroups only.",
|
||||
)
|
||||
if message.sender_chat and not TRUST_ANON_ADMINS:
|
||||
if message.sender_chat and (not TRUST_ANON_ADMINS or ALLOW_CHANNEL):
|
||||
ANON[int(f"{message.chat.id}{message.id}")] = (
|
||||
message,
|
||||
func,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ __HELP__ = """"
|
|||
@app.on_message(
|
||||
filters.incoming & ~filters.private & filters.command(["inkick"], COMMAND_HANDLER)
|
||||
)
|
||||
@app.adminsOnly("can_restrict_members")
|
||||
@app.adminsOnly("can_restrict_members", ALLOW_CHANNEL=True)
|
||||
async def inkick(_, message):
|
||||
user = await app.get_chat_member(message.chat.id, message.from_user.id)
|
||||
if user.status.value in ("administrator", "owner"):
|
||||
|
|
@ -77,7 +77,7 @@ async def inkick(_, message):
|
|||
@app.on_message(
|
||||
filters.incoming & ~filters.private & filters.command(["uname"], COMMAND_HANDLER)
|
||||
)
|
||||
@app.adminsOnly("can_restrict_members")
|
||||
@app.adminsOnly("can_restrict_members", ALLOW_CHANNEL=True)
|
||||
async def uname(_, message):
|
||||
user = await app.get_chat_member(message.chat.id, message.from_user.id)
|
||||
if user.status.value in ("administrator", "owner"):
|
||||
|
|
@ -125,7 +125,7 @@ async def uname(_, message):
|
|||
& ~filters.private
|
||||
& filters.command(["ban_ghosts"], COMMAND_HANDLER)
|
||||
)
|
||||
@app.adminsOnly("can_restrict_members")
|
||||
@app.adminsOnly("can_restrict_members", ALLOW_CHANNEL=True)
|
||||
async def rm_delacc(_, message):
|
||||
user = await app.get_chat_member(message.chat.id, message.from_user.id)
|
||||
if user.status.value in ("administrator", "owner"):
|
||||
|
|
@ -168,7 +168,7 @@ async def rm_delacc(_, message):
|
|||
@app.on_message(
|
||||
filters.incoming & ~filters.private & filters.command(["instatus"], COMMAND_HANDLER)
|
||||
)
|
||||
@app.adminsOnly("can_restrict_members")
|
||||
@app.adminsOnly("can_restrict_members", ALLOW_CHANNEL=True)
|
||||
async def instatus(client, message):
|
||||
bstat = await app.get_chat_member(message.chat.id, client.me.id)
|
||||
if bstat.status.value != "administrator":
|
||||
|
|
|
|||
Loading…
Reference in a new issue