Exemple #1
0
        private ReplyKeyboardMarkup CreateStartKeyboard()
        {
            var keyboard = new ReplyKeyboardMarkup(new[]
            {
                groupProvider
                .GetAllGroups()
                .Select(x => new KeyboardButton(x))
                .ToArray()
            });

            return(keyboard);
        }
Exemple #2
0
        public List <string> GetCommands()
        {
            var groups = groupProvider
                         .GetAllGroups()
                         .ToList();

            return(new List <string> {
                "help", "/help", "помощь", "помоги"
            }
                   .Concat(groups)
                   .ToList());
        }
Exemple #3
0
        private MessageKeyboard CreateStartKeyboard()
        {
            var keyboard    = new MessageKeyboard();
            var buttonsList = new List <List <MessageKeyboardButton> >();
            var buttons     = groupProvider
                              .GetAllGroups()
                              .Select(x => new MessageKeyboardButton
            {
                Action = new MessageKeyboardButtonAction
                {
                    Label = x,
                    Type  = KeyboardButtonActionType.Text
                },

                Color = KeyboardButtonColor.Primary
            })
                              .ToList();

            buttonsList.Add(buttons);
            keyboard.Buttons = buttonsList;
            return(keyboard);
        }
Exemple #4
0
 public DataTable GetAllGroups()
 {
     return(GroupProvider.GetAllGroups());
 }