diff --git a/list.json b/list.json index 028fcc2..aef199d 100644 --- a/list.json +++ b/list.json @@ -62,13 +62,13 @@ }, { "name": "xtao-some", - "version": "1.14", + "version": "1.154", "section": "daily", "maintainer": "xtaodada", "size": "18.8 kb", "supported": true, "des-short": "一大堆便民功能。", - "des": "超多功能 例如 -ip -ipping -guess 等。" + "des": "超多功能 例如 -ip -ipping -guess -t -getdel 等。" }, { "name": "yb-dl", @@ -362,7 +362,7 @@ }, { "name": "keyword", - "version": "2.55", + "version": "2.551", "section": "chat", "maintainer": "c3b2a,xtaodada", "size": "36.7 kb", diff --git a/xtao-some.py b/xtao-some.py index 9fda6e3..a189d32 100644 --- a/xtao-some.py +++ b/xtao-some.py @@ -1,11 +1,10 @@ """ Pagermaid plugin base. """ import json, requests, re -from translate import Translator as trans from urllib.parse import urlparse from pagermaid import bot, log from pagermaid.listener import listener, config from pagermaid.utils import clear_emojis, obtain_message, attach_log -from telethon.tl.types import ChannelParticipantsAdmins +from telethon.errors import ChatAdminRequiredError from os import remove @@ -254,3 +253,24 @@ async def tx_t(context): await attach_log(result, context.chat_id, "translation.txt", context.id) return await context.edit(result) + + +@listener(is_plugin=True, outgoing=True, command="getdel", + description="获取当前群组/频道的死号数。") +async def getdel(context): + """ PagerMaid getdel. """ + cid = str(context.chat_id) + pri = cid.startswith('-100') + if pri: + member_count = 0 + try: + await context.edit('遍历成员中。。。') + chat = await context.get_chat() + async for member in bot.iter_participants(chat): + if member.deleted: + member_count += 1 + await context.edit(f'此频道/群组的死号数:`{member_count}`') + except ChatAdminRequiredError: + await context.edit('未加入此频道。') + else: + await context.edit("请在在群组/频道发送。")