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.
I have this method:
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 (printwe have an update
) that it has sent.I send messages using
execute
method withchat_id
set to the channel's id. The messages the bot sents to the channel, get displayed as sent under the channel's name.