直接看代码

from telethon.tl.functions.channels import GetParticipantsRequest
from telethon.tl.types import ChannelParticipantsSearch

async def get_group_members(group):
    members = await client(GetParticipantsRequest(
        channel=group,
        filter=ChannelParticipantsSearch(''),
        offset=0,
        limit=100,
        hash=0
    ))
    print(f"群组 {group.id} 的成员列表:")
    for member in members.users:
        print(f"ID: {member.id}, 用户名: {member.username}")
    return members.users
分类: telethonPython 标签: pythontelethon

评论

暂无评论数据

暂无评论数据

目录