Merge pull request #86 from Pentacene/master

atadmins_atall 1.12 回复回复的消息
This commit is contained in:
Pentacene 2020-12-03 21:22:48 +08:00 committed by GitHub
commit ce1ca6097d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View File

@ -8,7 +8,7 @@ import time
@listener(is_plugin=True, outgoing=True, command="atadmins", @listener(is_plugin=True, outgoing=True, command="atadmins",
description="一键 AT 本群管理员(仅在群组中有效)", description="一键 AT 本群管理员(仅在群组中有效)",
parameters="<要说的话>") parameters="回复消息(可选) <要说的话(可选)>")
async def atadmins(context): async def atadmins(context):
await context.edit('正在获取管理员列表中...') await context.edit('正在获取管理员列表中...')
chat = await context.get_chat() chat = await context.get_chat()
@ -29,13 +29,16 @@ async def atadmins(context):
elif admin.first_name is not None: elif admin.first_name is not None:
admin_list.extend(['[' + admin.first_name + '](tg://user?id=' + str(admin.id) + ')']) admin_list.extend(['[' + admin.first_name + '](tg://user?id=' + str(admin.id) + ')'])
send_list = ' , '.join(admin_list) send_list = ' , '.join(admin_list)
# print(send_list) reply = await context.get_reply_message()
await context.reply("%s\n\n%s" % (say, send_list)) if reply:
# await context.reply(' , '.join(admin_list)) await reply.reply(f'{say}:\n{send_list}')
else:
await context.reply(f'{say}:\n{send_list}')
await context.delete() await context.delete()
@listener(is_plugin=True, outgoing=True, command="atall", @listener(is_plugin=True, outgoing=True, command="atall",
description="一键 AT 本群成员(仅在群组中有效)") description="一键 AT 本群成员(仅在群组中有效)",
parameters="回复消息(可选) <要说的话(可选)>")
async def atall(context): async def atall(context):
await context.edit('正在获取成员列表中...') await context.edit('正在获取成员列表中...')
chat = await context.get_chat() chat = await context.get_chat()
@ -63,5 +66,9 @@ async def atall(context):
user_list = [] user_list = []
time.sleep(1) time.sleep(1)
text = ' , '.join(user_list) text = ' , '.join(user_list)
await context.reply("%s\n\n%s" % (say, text)) reply = await context.get_reply_message()
if reply:
await reply.reply(f'{say}:\n{text}')
else:
await context.reply(f'{say}:\n{text}')
await context.delete() await context.delete()

View File

@ -112,7 +112,7 @@
}, },
{ {
"name": "atadmins_atall", "name": "atadmins_atall",
"version": "1.11", "version": "1.12",
"section": "chat", "section": "chat",
"maintainer": "Pentacene", "maintainer": "Pentacene",
"size": "2.5 kb", "size": "2.5 kb",