rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.68k stars 1.18k forks source link

Ability command does not triggering in certain cases #768

Closed Melodeiro closed 4 years ago

Melodeiro commented 4 years ago

When i type command with some text on next line, it does not working:

/test
text1
text2

But if i type something on the first line it is working:

/test something
text1
text2

Im using 4.9 version, with AbilityBuilder and name(test) method.

addo47 commented 4 years ago

The command mechanism splits the input by ' ' then takes the initial token as the ability name. This won't work with multi-line.

I think this could be enhanced. In the meantime, you can always use a Reply to support this use case. https://github.com/rubenlagus/TelegramBots/wiki/Using-Replies

addo47 commented 4 years ago

@Melodeiro Can you verify if this is still not addressed? If it is, can you close the issue? Thanks!

Here's the reference to the new methods introduced to customize the way we process text.

https://github.com/rubenlagus/TelegramBots/wiki/Advanced

Melodeiro commented 4 years ago

Added custom regex for spaces and newlines, and it is working as i wanted, thank you