mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 21:56:28 +00:00
xtao-some getdel 支持只查询不删除
This commit is contained in:
parent
c67c9b44ee
commit
96e019538a
@ -62,7 +62,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "xtao-some",
|
"name": "xtao-some",
|
||||||
"version": "1.19",
|
"version": "1.20",
|
||||||
"section": "daily",
|
"section": "daily",
|
||||||
"maintainer": "xtaodada",
|
"maintainer": "xtaodada",
|
||||||
"size": "18.8 kb",
|
"size": "18.8 kb",
|
||||||
|
@ -279,6 +279,9 @@ async def getdel(context):
|
|||||||
""" PagerMaid getdel. """
|
""" PagerMaid getdel. """
|
||||||
cid = str(context.chat_id)
|
cid = str(context.chat_id)
|
||||||
pri = cid.startswith('-100')
|
pri = cid.startswith('-100')
|
||||||
|
parameter = None
|
||||||
|
if len(context.parameter) == 1:
|
||||||
|
parameter = context.parameter[0]
|
||||||
if pri:
|
if pri:
|
||||||
member_count = 0
|
member_count = 0
|
||||||
try:
|
try:
|
||||||
@ -291,13 +294,13 @@ async def getdel(context):
|
|||||||
async for member in bot.iter_participants(chat):
|
async for member in bot.iter_participants(chat):
|
||||||
if member.deleted:
|
if member.deleted:
|
||||||
member_count += 1
|
member_count += 1
|
||||||
if need_kick:
|
if need_kick and parameter:
|
||||||
try:
|
try:
|
||||||
await context.client.kick_participant(context.chat_id, member.id)
|
await context.client.kick_participant(context.chat_id, member.id)
|
||||||
except FloodWaitError:
|
except FloodWaitError:
|
||||||
await context.edit('处理失败,您已受到 TG 服务器限制。')
|
await context.edit('处理失败,您已受到 TG 服务器限制。')
|
||||||
return
|
return
|
||||||
if need_kick:
|
if need_kick and parameter:
|
||||||
await context.edit(f'此频道/群组的死号数:`{member_count}`,并且已经清理完毕。')
|
await context.edit(f'此频道/群组的死号数:`{member_count}`,并且已经清理完毕。')
|
||||||
else:
|
else:
|
||||||
await context.edit(f'此频道/群组的死号数:`{member_count}`。')
|
await context.edit(f'此频道/群组的死号数:`{member_count}`。')
|
||||||
|
Loading…
Reference in New Issue
Block a user