Update BotBase.cs

fixing new command handling
This commit is contained in:
FlorianDahn 2020-04-11 19:42:24 +02:00
parent 25a0ff2e3e
commit a1b3b9246b

View File

@ -256,8 +256,8 @@ namespace TelegramBotBase
ds.LastAction = DateTime.Now; ds.LastAction = DateTime.Now;
ds.LastMessage = e.Message; ds.LastMessage = e.Message;
//Is this a systemcall ? //Is this a bot command ?
if (e.IsBotCommand && this.BotCommands.Count(a => a.Command == e.BotCommand) > 0) if (e.IsBotCommand && this.BotCommands.Count(a => "/" + a.Command == e.BotCommand) > 0)
{ {
var sce = new BotCommandEventArgs(e.BotCommand, e.BotCommandParameters, e.Message, ds.DeviceId, ds); var sce = new BotCommandEventArgs(e.BotCommand, e.BotCommandParameters, e.Message, ds.DeviceId, ds);
await OnBotCommand(sce); await OnBotCommand(sce);