atadmins 一键 AT 本群管理员

This commit is contained in:
xtaodada 2022-07-21 21:40:55 +08:00
parent 008e92e8b9
commit 1c0b1d33c4
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 32 additions and 0 deletions

22
atadmins/main.py Normal file
View File

@ -0,0 +1,22 @@
from pyrogram.enums import ChatMembersFilter
from pagermaid.listener import listener
from pagermaid.single_utils import Message
@listener(command="atadmins",
description="一键 AT 本群管理员(仅在群组中有效)",
groups_only=True,
parameters="<要说的话>")
async def at_admins(message: Message):
admins = []
async for m in message.bot.get_chat_members(message.chat.id, filter=ChatMembersFilter.ADMINISTRATORS):
if not m.user.is_bot and not m.user.is_deleted:
admins.append(m.user.mention)
if not admins:
return await message.edit("❌ 没有管理员")
say = message.arguments or "召唤本群所有管理员"
send_list = ' , '.join(admins)
await message.bot.send_message(message.chat.id, "%s\n\n%s" % (say, send_list),
reply_to_message_id=message.reply_to_message_id)
await message.safe_delete()

View File

@ -409,6 +409,16 @@
"supported": true,
"des-short": "获取 Bing 每日壁纸。",
"des": "获取 Bing 每日壁纸。\n指令,bingwall"
},
{
"name": "atadmins",
"version": "1.0",
"section": "chat",
"maintainer": "xtaodada、Pentacene",
"size": "0.96 kb",
"supported": true,
"des-short": "一键 AT 本群管理员。",
"des": "一键 AT 本群管理员。\n指令,atadmins"
}
]
}