Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
stormstricker opened this issue Sep 13, 2019 · 1 comment

Comments

@stormstricker
Copy link

stormstricker commented Sep 13, 2019

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant