【问题标题】:GetDialogRequest for bot; telethon for python机器人的 GetDialogRequest; python的电视马拉松
【发布时间】:2022-09-27 22:51:18
【问题描述】:

我正在尝试实现一个具有自动销毁功能的机器人,并且正如在另一个讨论中所建议的那样,我正在尝试仅使用 telethon api。但是当我试图让所有用户进入这样的列表时:

chats = []
    last_date = None
    chunk_size = 900
    groups=[]   
    result = bot(GetDialogsRequest(
                offset_date=last_date,
                offset_id=0,
                offset_peer=InputPeerEmpty(),
                limit=chunk_size,
                hash = 0
            ))
    await chats.extend(result.chats)

    print(\'[+] scegli il gruppo dove vuoi bannare gli utenti:\')
    i=0
    for g in groups:
        print(\'[\' + str(i) + \']\' + \' - \'+ g.title )
        i+=1
    g_index = input(\"inserisci il numero del gruppo scelto: \")
    target_group=groups[int(g_index)]
 
    print(\"Seleziono gli utenti...\")
    time.sleep(1)
    all_participants = []
    all_participants = await bot.get_participants(target_group, aggressive=False)

但它返回此错误,说我不能在机器人中使用 getDialogsRequest

telethon.errors.rpcerrorlist.BotMethodInvalidError: The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot (caused by GetDialogsRequest)

我不知道如何访问除管理员以外的用户列表,有什么想法吗?

    标签: python api bots telegram telethon


    【解决方案1】:

    机器人帐户无法获得对话。这是电报限制。没有其他办法了。

    【讨论】:

      猜你喜欢
      • 2015-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-27
      • 2020-10-28
      • 1970-01-01
      相关资源
      最近更新 更多