Search code examples
telegram-botpython-telegram-bot

How to avoid Bot repeating command in groups?


I created a new Telegram Bot which maintains a simple list. When I chat with the Bot directly (in PMs) the Bot works as intended.

Working as intended

I created this bot for a group of friends, so I added the bot to the group, and now, whenever I execute a command, the bot responds, but also repeats my command. Is there any way to avoid this behavior?

Bot in Group

I am using the python-telegram-bot API and sending messages using update.message.reply_text('My message')

Is this just intended behavior or is there any way to avoid the bot repeating the sent command?


Solution

  • I found the solution. Telegram API understands this as quoting, and is enabled in groups by default, disabled in private chats. It can be disabled by using:

    update.message.reply_text("message", quote=False)