private ReplyKeyboardMarkup CreateStartKeyboard() { var keyboard = new ReplyKeyboardMarkup(new[] { groupProvider .GetAllGroups() .Select(x => new KeyboardButton(x)) .ToArray() }); return(keyboard); }
public List <string> GetCommands() { var groups = groupProvider .GetAllGroups() .ToList(); return(new List <string> { "help", "/help", "помощь", "помоги" } .Concat(groups) .ToList()); }
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); }
public DataTable GetAllGroups() { return(GroupProvider.GetAllGroups()); }