python - chat.megagroup 未显示 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
在m==2
中,显示了所有组。你能指导我做错了什么还是别的什么?
解决方案
推荐阅读
- python - 如何根据另一列的两个连续值在熊猫的新列中添加标签?
- javascript - 如何在反应钩子中使用复选框过滤获取的数据
- python - 如何将多个分类列转换为在 PySpark 中保持共享值的整数?
- android - 如何在底部导航栏添加一行
- discord - Discord.py 投票命令没有响应
- python - 使用 asyncio 协程并行运行函数?
- javascript - TypeError:无法读取未定义的属性“执行”(Discord.js)
- javascript - AG-Grid agNumberColumnFilter 不适用于 valueFormatter 中的计算值
- javascript - 拉取firebase文档获取多余数据
- python - 导入csv,每行列数不一致,原始标题使用熊猫