小编CoD*_*ign的帖子

并非所有组都在 Telethon 中可见

我使用chat.megagroup==true 它没有显示所有频道(在m==1),而且它也有问题,例如有时显示 A 组和 B 组,有时显示 A 或 B,有时显示 C 组,不知道为什么甚至无需更改代码中的任何内容即可发生。

该脚本总体工作正常,但唯一的问题是我有时没有需要使用的组。

result = client(GetDialogsRequest(
             offset_date=last_date,
             offset_id=0,
             offset_peer=InputPeerEmpty(),
             limit=chunk_size,
             hash = 0))

chats.extend(result.chats)
dialogs = client.get_dialogs()

m = input("1: For only permitted groups \n2: For all groups\n")
if m=='1':
    for chat in chats:
        try:
            if chat.megagroup == True:
                groups.append(chat)
        except:
            continue
elif m=='2':
    for i in dialogs:
        try:
            i.entity.status
        except:
            groups.append(i)
            continue
Run Code Online (Sandbox Code Playgroud)

在 中m==2,显示了所有组。你能指导我做错了什么还是别的什么?

python telegram telethon

2
推荐指数
1
解决办法
3056
查看次数

标签 统计

python ×1

telegram ×1

telethon ×1