mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-22 03:19:18 +00:00
atadmins 一键 AT 本群管理员
This commit is contained in:
parent
008e92e8b9
commit
1c0b1d33c4
22
atadmins/main.py
Normal file
22
atadmins/main.py
Normal 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()
|
10
list.json
10
list.json
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user