【问题标题】:Unable to get my messages from a Telegram group with MadelineProto无法使用 MadelineProto 从 Telegram 组获取我的消息
【发布时间】:2022-08-11 15:33:34
【问题描述】:

我想得到我的最新消息,它是我发送到电报组的 id。之后我想删除它。但我做不到。这是我正在尝试的。这段代码带来了成员发送的所有消息,而不仅仅是我。如何获取最新消息并将其删除?

$messages_Messages = $MadelineProto->messages->getHistory([\'peer\' => \'@\'.$group, 

\'offset_id\' => 0,
\'offset_date\' => 1642698525, 
\'add_offset\' => 0, 
\'limit\' => 3, 
\'max_id\' => 2147483646, 
\'min_id\' => 0, 
\'hash\' => 0 ]);

 print_r($messages_Messages);

    标签: telegram telegram-bot php-telegram-bot


    【解决方案1】:

    Watch how delete messages in docs

    但是您需要整理您的数组(foreach)并找到最后一条消息(此数组中的第一个)并获取 message_id

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-10
      • 2021-10-04
      • 2016-04-04
      • 1970-01-01
      • 2019-03-09
      • 2019-10-11
      • 2016-11-27
      • 2017-11-28
      相关资源
      最近更新 更多