【问题标题】:telethon how to get 'alert' message?电视节目如何获得“警报”消息?
【发布时间】:2021-11-07 13:01:18
【问题描述】:

如何获得“警报”消息?

我的代码:

@client.on(events.NewMessage(chats=group_to_enter))
async def handler(event):
    buttons = await event.get_buttons()
    for bline in buttons:
        for button in bline:
            print(button.button.text)
            await button.click()

但此代码无法获得仅显示在组中的警报消息

【问题讨论】:

    标签: python-3.x telegram telethon


    【解决方案1】:

    结果从Message.click(或MessageButton.click)返回:

    result = await button.click()
    print(result)
    

    【讨论】:

    • 谢谢 lonami,我看到了警报文本。另一个问题是当代码执行button.click() 时,它会单击警报按钮吗?如果没有,那我该怎么做。我搜索了互联网并没有找到任何答案。抱歉,如果这是一个转储问题
    • 没有办法点击警报按钮来“关闭”它。在官方客户端上,它只是关闭模式。
    猜你喜欢
    • 1970-01-01
    • 2019-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-18
    • 1970-01-01
    • 2020-05-30
    • 2018-06-15
    相关资源
    最近更新 更多