🌀 尝试新增AT全体管理功能

This commit is contained in:
xtaodada 2020-04-02 20:42:38 +08:00
parent 75292a48c4
commit 015d5980f7
No known key found for this signature in database
GPG Key ID: 39EFACA711DF5D8C

View File

@ -3,7 +3,7 @@
import requests
import json
from telethon.tl.functions.messages import DeleteChatUserRequest
from telethon.tl.functions.channels import LeaveChannelRequest,GetParticipantsRequest
from telethon.tl.functions.channels import LeaveChannelRequest, GetParticipantsRequest
from telethon.tl.types import ChannelParticipantsAdmins
from telethon.errors.rpcerrorlist import ChatIdInvalidError
from distutils2.util import strtobool
@ -183,7 +183,12 @@ async def get_admin(context):
await context.edit("正在获取管理员列表。")
get_admin_lists = []
try:
for user in bot(GetParticipantsRequest(channel=context.chat_id, filter=ChannelParticipantsAdmins)):
async for user in bot(GetParticipantsRequest(channel=context.chat_id,
filter=ChannelParticipantsAdmins,
offset=42,
limit=100,
hash=0
)):
get_admin_lists.extend(['[' + str(user.first_name) + '](tg://user?id=' + str(user.id) + ')'])
await context.edit(' '.join(get_admin_lists))
except:
@ -205,8 +210,9 @@ async def site(context):
""" Outputs the site URL. """
await context.edit("https://katonkeyboard.moe/pagermaid.html")
@listener(outgoing=True, command="sources",
description="显示 PagerMaid-Modify 存储库的URL。")
async def sources(context):
""" Outputs the repository URL. """
await context.edit("https://github.com/xtaodada/PagerMaid-Modify/")
await context.edit("https://github.com/xtaodada/PagerMaid-Modify/")