danog / MadelineProto

Async PHP client API for the telegram MTProto protocol
https://docs.madelineproto.xyz
GNU Affero General Public License v3.0
2.8k stars 636 forks source link

Update of channel message send twice when we dont use IsNotEdited Filter #1530

Open mtalaeii opened 1 month ago

mtalaeii commented 1 month ago

Description

This is serious problem that couse when we have disscussion group with connected to channel

Reproduce

use the code below

#[Handler]
public function commentHandler(ChannelMessage $message)
{
    $message->getDiscussion()->reply("hello");
}

This will send hello twice on disscusion group even if the post is not edited on channel!!!

Simple Fix

#[Handler]
public function commentHandler(ChannelMessage&IsNotEdited $message)
{
    $message->getDiscussion()->reply("hello");
}

As i say this is not a real fix because the post in channel not edited and not have any reaction and it send hello just 1 in this case