Upgrading BotCommands to new BotCommandScope format

- adding IsKnownBotCommand method to BotBase
- updated UploadBotCommand method to new format
- adding new Commandformat to BotBaseBuilder
- adding AddChatCommand and ClearChatCommand for custom Chat commands
- integrating new checks into FormBaseMessageLoop
This commit is contained in:
FlorianDahn
2022-05-15 23:20:16 +02:00
parent 2c567419ec
commit 707ffd492f
4 changed files with 67 additions and 13 deletions
@@ -37,7 +37,7 @@ namespace TelegramBotBase.Factories.MessageLoops
}
//Is this a bot command ?
if (mr.IsFirstHandler && mr.IsBotCommand && Bot.BotCommands.Count(a => "/" + a.Command == mr.BotCommand) > 0)
if (mr.IsFirstHandler && mr.IsBotCommand && Bot.IsKnownBotCommand(mr.BotCommand))
{
var sce = new BotCommandEventArgs(mr.BotCommand, mr.BotCommandParameters, mr.Message, session.DeviceId, session);
await Bot.OnBotCommand(sce);