Exemplo n.º 1
0
        public async Task ExecuteAsync(Message message)
        {
            switch (message.Text.ToLower())
            {
            case "да":
                _states.AddState(message.Chat.Id, Name, NextName);
                await _bot.SendTextMessageAsync(message.Chat.Id, _constants.Messages.ChooseCategory, replyMarkup : _constants.GetReplyKeyboardMarkupByCategories());

                break;

            case "нет":
                _states.ClearState(message.Chat.Id);
                await _bot.SendTextMessageAsync(message.Chat.Id,
                                                _constants.Messages.IfIsNotNew);

                break;
            }
        }
Exemplo n.º 2
0
        public async Task ExecuteAsync(Message message)
        {
            var state = _states.GetState(message.Chat.Id);

            if (state != null)
            {
                if (!state.IsFinished)
                {
                    _states.ClearState(message.Chat.Id);
                    await _bot.SendTextMessageAsync(message.Chat.Id, _constants.Messages.CancelFillng);
                }
                else
                {
                    await _bot.SendTextMessageAsync(message.Chat.Id, _constants.Messages.NothingCancel);
                }
            }
            else
            {
                await _bot.SendTextMessageAsync(message.Chat.Id, _constants.Messages.NothingCancel);
            }
        }
Exemplo n.º 3
0
        public async Task ExecuteAsync(Message message)
        {
            _repository.ClearState(message.Chat.Id);

            _repository.AddState(message.Chat.Id, Name, NextName);
            var rkm = new ReplyKeyboardMarkup();

            rkm.ResizeKeyboard = true;
            rkm.Keyboard       =
                new[]
            {
                new[]
                {
                    new KeyboardButton(_constants.Messages.SendLocation)
                    {
                        RequestLocation = true
                    }
                }
            };

            await _bot.SendTextMessageAsync(
                message.Chat,
                _constants.Messages.SendLocation, replyMarkup : rkm);
        }