Skip to content
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

Bot Fails to Process Telegram Messages from Other Bots Despite shouldIgnoreBotMessages: false Setting #2076

Open
MbBrainz opened this issue Jan 9, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@MbBrainz
Copy link
Contributor

MbBrainz commented Jan 9, 2025

Describe the bug

The bot does not read or receive Telegram bot messages, even though the setting clientConfig.telegram.shouldIgnoreBotMessages is set to false.

To Reproduce

  1. Configure the bot with the following settings:
    clientConfig: {
        telegram: {
            shouldIgnoreBotMessages: false,
        },
    }
    
     2.	Start the bot using the pnpm i && pnpm start command.
     3.	Send a message from another Telegram bot to the configured bot.
     4.	Observe that the bot does not process or respond to the message.
    

Expected behavior

The bot should receive and process messages from other Telegram bots when shouldIgnoreBotMessages is explicitly set to false.

Screenshots

Additional context

Logs during startup and execution indicate no specific errors regarding message handling:
• Initialization appears successful with services like browser, image_description, and telegram being registered and started.
• The bot successfully launches and binds to the correct Telegram username .
• However, the bot does not respond to messages from other bots

These issues might suggest:
1. The Telegram client is mishandling bot-specific messages despite the configuration.
2. A bug in how the message handler processes bot-originating messages.

Logs for reference:
• Setting initialization:

clientConfig: {
    telegram: {
        shouldIgnoreBotMessages: false,
    },
}

Proposed steps for debugging:
1. Verify if the Telegram client is correctly handling shouldIgnoreBotMessages.
2. Debug the message handler to confirm it processes messages from other bots.
3. Ensure the bot’s agent is correctly linked to the Telegram service.
4. Test with verbose logging enabled for better insight into incoming message handling.

@MbBrainz MbBrainz added the bug Something isn't working label Jan 9, 2025
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Hello @MbBrainz! Welcome to the ai16z community. Thank you for opening your first issue; we appreciate your contribution. You are now a ai16z contributor!

@rferrari
Copy link

rferrari commented Jan 10, 2025

I also noticed that, and as far my debug went, it not trigger the bot.on("message" Handler. so, this config will not take effect. I`m wondering if is a config from telegram bot or something else...

i found this:
https://stackoverflow.com/questions/78312360/python-telegram-bot-does-not-reply-to-messages-sent-by-another-bot

That's not possible, bots can never read messages from other bots.
You'll have to let the second both trigger on something else. You could for example read it from the database or implement another way of sending 'events' to the second bot.

The bots only can receive messages from other bots in channels. Not in groups nor private chats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants