diff --git a/dc/main.py b/dc/main.py index 577dcbb..b4ed944 100644 --- a/dc/main.py +++ b/dc/main.py @@ -28,7 +28,7 @@ async def dc(bot: Client, context: Message): count = await bot.get_chat_members_count(context.chat.id) if count >= 10000 and context.arguments != "force": return await context.edit("太...太多人了... 我会...会...会坏掉的...\n\n如果您执意要运行的的话,您可以使用指令 ,dc force") - users = bots_deleted = 0 + users = bots = deleted = 0 dc_ids = {"1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "failed": 0} async for m in bot.get_chat_members(context.chat.id, limit=9999): if not m.user.is_bot and not m.user.is_deleted: @@ -37,8 +37,10 @@ async def dc(bot: Client, context: Message): dc_ids[str(m.user.dc_id)] += 1 except: dc_ids["failed"] += 1 + elif m.user.is_bot: + bots += 1 else: - bots_deleted += 1 + deleted += 1 await context.edit(f"""DC: > DC1用户: **{dc_ids["1"]}** 分遗产占比: **{round((dc_ids["1"]/users)*100, 2)}%** > DC2用户: **{dc_ids["2"]}** 分遗产占比: **{round((dc_ids["2"]/users)*100, 2)}%** @@ -46,6 +48,6 @@ async def dc(bot: Client, context: Message): > DC4用户: **{dc_ids["4"]}** 分遗产占比: **{round((dc_ids["4"]/users)*100, 2)}%** > DC5用户: **{dc_ids["5"]}** 分遗产占比: **{round((dc_ids["5"]/users)*100, 2)}%** > 无法获取在哪个DC的用户: **{dc_ids["failed"]}** -> 已自动过滤掉 **{bots_deleted}** 个 Bot / 死号 +> 已自动过滤掉 **{bots}** 个 Bot, **{deleted}** 个 死号 {'***请注意: 由于tg限制 我们只能遍历前10k人 此次获得到的数据并不完整***' if count >= 10000 else ''}""", parse_mode = ParseMode.MARKDOWN) diff --git a/list.json b/list.json index 49fbcbf..99a018d 100644 --- a/list.json +++ b/list.json @@ -192,7 +192,7 @@ }, { "name": "premium", - "version": "1.004", + "version": "1.005", "section": "chat", "maintainer": "xiluo", "size": "2.0 kb", @@ -212,7 +212,7 @@ }, { "name": "dc", - "version": "1.002", + "version": "1.004", "section": "chat", "maintainer": "xiluo", "size": "2.3 kb", diff --git a/premium/main.py b/premium/main.py index 518fec4..0eb3f38 100644 --- a/premium/main.py +++ b/premium/main.py @@ -15,7 +15,7 @@ from pyrogram.enums import ChatMemberStatus, ParseMode description="分遗产咯") async def premium(bot: Client, context: Message): context = await context.edit("Please wait...") - premium_users = users = admins = premium_admins = bots_deleted = 0 + premium_users = users = admins = premium_admins = bots = deleted = 0 dc_ids = {"1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "failed": 0} count = await bot.get_chat_members_count(context.chat.id) if count >= 10000 and context.arguments != "force": @@ -33,8 +33,10 @@ async def premium(bot: Client, context: Message): premium_admins += 1 if m.status in [ChatMemberStatus.OWNER, ChatMemberStatus.ADMINISTRATOR]: admins += 1 + elif m.user.is_bot: + bots += 1 else: - bots_deleted += 1 + deleted += 1 await context.edit(f"""**分遗产咯** 管理员: @@ -43,6 +45,6 @@ async def premium(bot: Client, context: Message): 用户: > 大会员: **{premium_users}** / 总用户数: **{users}** 分遗产占比: **{round((premium_users/users)*100, 2)}%** -> 已自动过滤掉 **{bots_deleted}** 个 Bot / 死号 +> 已自动过滤掉 **{bots}** 个 Bot, **{deleted}** 个 死号 {'***请注意: 由于tg限制 我们只能遍历前10k人 此次获得到的数据并不完整***' if count >= 10000 else ''}""", parse_mode = ParseMode.MARKDOWN)