Closed avannus closed 4 years ago
Do you extend your bot from TelegramLongPollingCommandBot? Maybe related to the issue that I created, https://github.com/rubenlagus/TelegramBots/issues/716. But for me, even normal command don't work at all.
No, my bot extends the AbilityBot (AbsSender -> DefaultAbsSender -> BaseAbilityBot -> AbilityBot -> MyBot). Normal commands work for me (as long as the bot receives them obviously)
Hey @avannus,
Thanks for using AbilityBot! I'll be here to help you. Have you properly passed in the botUsername in the constructor? That's what's used when commands are getting matched.
Also, adding a print statement behind the return won't be printed on ability execution. Abilities are fetched once and used later on. If you'd like anything to be printed, it must be in the .action
or .post
methods.
Seems like that was the issue @addo37! I have the bot name as its variable display name, not the actual username. When I DM the bot with /roll@BotDisplayName, it responds (unlike /roll@BotUserName). Should be an easy fix when I get home.
Also, good to know about the Abilities.
Thanks!
The bot doesn't recognize /roll@bot commands but does resolve /roll commands
I have added a print statement before the return line and it doesn't print even though the bot sees it as a command (The bot is running in privacy mode and the message is definitely considered)
From the console log:
entities=[MessageEntity{type='bot_command', offset=0, length=15, url=null, user=null}]
I can't create a method with .name("roll@bot") because the @ isn't alphanumeric (nor is the bot name)
Is there a way to fix this?