rubenlagus / TelegramApi

Java library to create Telegram Clients
MIT License
300 stars 108 forks source link

onUpdateReceived (Update update) method doesn't react to messages sent by the same bot that method is in #85

Open stormstricker opened 5 years ago

stormstricker commented 5 years ago

I have this method:

public class MyBot extends TelegramLongPollingBot {
    @Override
    public void onUpdateReceived(Update update) {
        System.out.println("we have an update!");
...

That prints we have an update! just fine when it's me (a user) sending a message to a channel. But if the sender is that same bot, it doesn't react (doesn't print anything). Is there a way to cope with it? I need the bot to react to messages (print we have an update) that it has sent.

I send messages using execute method with chat_id set to the channel's id. The messages the bot sents to the channel, get displayed as sent under the channel's name.

stormstricker commented 5 years ago

The only way I managed to solve it is by adding a second bot to the same channel that gets the updates sent by the first bot. It works fine.