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