Otann / morse

📡 Clojure interface for Telegram Bot API
Eclipse Public License 1.0
257 stars 48 forks source link

Support /command@YourBot style commands #12

Closed miikka closed 7 years ago

miikka commented 7 years ago

If there are multiple bots in a group, you can disambiguate commands by postfixing the command with bot's @username, e.g. /command@YourBot. When autocompleting a command (if you have told Telegram about your bot's commands via /setcommands to BotFather), Telegram does this automatically.

It'd be great if morse.handlers/command would support this out of the box. If I understand Telegram's FAQ correctly, you won't ever get messages that were meant for other bots in the group, even if your bot is not in the privacy mode. This means morse could just split the received commands on @ and match on the first part - there's no need to know the bot's username.

Otann commented 7 years ago

That is a wonderful idea, thank you! I will try to implement it in next couple of weeks, but can't promise anything. Also PRs are much welcomed ;)

deril commented 7 years ago

Fixed in #14

miikka commented 7 years ago

14 is included in version 0.2.4. Seems to work.