示例#1
0
        public async Task ExecuteCommand(TelegramCommand command)
        {
            //TODO: Maybe throw exception or log
            if (!CanExecute(command))
            {
                return;
            }

            await _botService.Client.SendTextMessageAsync(command.Message.Chat.Id, command.Rest);
        }
示例#2
0
 public bool CanExecute(TelegramCommand command)
 {
     return(command != null && command.IsCommand && command.CommandName == Command && !string.IsNullOrWhiteSpace(command.Rest));
 }