Ejemplo n.º 1
0
 public async Task ExecuteCommandAsync(Message message)
 {
     await _telegramBotClient.SendTextMessageAsync(
         chatId : message.Chat.Id,
         text : CommonMessage.GetMainMenuMessage(),
         replyMarkup : CommonKeyboard.GetMainMenuKeyboard());
 }
Ejemplo n.º 2
0
        public async Task ExecuteCommandAsync(Message message)
        {
            _storageService.AddOrUpdate(StorageKeys.BotCurrentState, BotStateType.None);

            await _telegramBotClient.SendTextMessageAsync(
                chatId : message.Chat.Id,
                text : CommonMessage.GetMainMenuMessage(),
                replyMarkup : CommonKeyboard.GetMainMenuKeyboard());
        }
        private async Task EnterPurpose(Message message)
        {
            var project = _storageService.Get <ProjectRequest>(StorageKeys.NewProject);

            project.Purpose = message.Text;

            await _digitalOceanClient.Projects.Create(project);

            await _telegramBotClient.SendTextMessageAsync(
                chatId : message.Chat.Id,
                text : CommonMessage.GetDoneMessage(),
                replyMarkup : CommonKeyboard.GetMainMenuKeyboard());
        }
 private async Task TrySendStartMessage()
 {
     try
     {
         await _telegramBotClient.SendTextMessageAsync(
             chatId : _userId,
             text : CommonMessage.GetMainMenuMessage(),
             replyMarkup : CommonKeyboard.GetMainMenuKeyboard());
     }
     catch (Exception ex)
     {
         if (ex.Message != "Forbidden: bot was blocked by the user")
         {
             _logger.LogError($"Error while trying to send message: {ex.Message}");
             throw;
         }
     }
 }