RainEggplant / chatgpt-telegram-bot

A ChatGPT bot for Telegram based on Node.js. Support both browserless and browser-base APIs.
MIT License
323 stars 97 forks source link

Telegram bot doesn't autofill bot name when command is issued without space in group chats #41

Closed chk86 closed 1 year ago

chk86 commented 1 year ago

Not a duplicate issue

Verify ChatGPT service is operational

Bot version

Latest

API type

official

Environment details

Docker

Describe the Bug

When issuing a command to the ChatGPT Telegram bot in a group chat, it currently accepts the format "/chat@bot-name". However, if there isn't a space between the command (/chat) and the bot name, Telegram doesn't autofill the bot name, which would be super helpful.

This issue appears to be specific to Telegram group chats.

It would be helpful if the bot could handle commands issued with a space between the command and the bot name in group chats, so that users can enter commands more easily and intuitively.

Thank you for your attention to this matter.

To Reproduce

No response

Logs

No response

Additional context

No response

RainEggplant commented 1 year ago

Hi! If I understand correctly, are you suggesting that the bot should be able to handle commands like /reset @bot_name in group chats?

As for autofilling, it is handled by the Telegram client and cannot be controlled by the bot. It seems that different clients have different implementations (Telegram Desktop can autofill the bot name in group chats, but Telegram Android cannot.)

And just in case, you only need to prepend your message with /chat in group chats. @bot_name is only required for commands (such as /reset@bot_name).

chk86 commented 1 year ago

That's correct. I'm not asking for autofilling, I understand that autofilling is handled by the Telegram client. Telegram iOS and Telegram Desktop both do auto-filling, but only when there is a space between the command and the chatbot name, which is why I made the request. Not sure if it's possible to have the bot recognize commands with and without a space.

But upon testing it further, it appears that the bot is responding to commands with or without a space. That wasn't the case before. Odd.

chk86 commented 1 year ago

Also, I just completely read your response and I missed the part where you only need to add the bot name for commands, but not for /chat. So I'll go ahead and close this out. Thanks!