예제 #1
0
        public override async Task <UpdateHandlingResult> HandleCommand(Update update, DefaultCommandArgs args)
        {
            string course = Regex.Match(args.RawInput,
                                        $@"[1-4]").Value;


            if (int.TryParse(course, out int courseNum))
            {
                await Bot.Client.SendTextMessageAsync(
                    update.Message.Chat.Id,
                    "Выбери группу:", replyMarkup : keyboards.GetGroupsOfCourseKeyboard(courseNum));
            }
            else
            {
                await Bot.Client.SendTextMessageAsync(
                    update.Message.Chat.Id,
                    "Нет такого курса - их всего 4...");
            }


            return(UpdateHandlingResult.Handled);
        }
예제 #2
0
 public ReplyKeyboardMarkup GetGroupsOfCourseKeyboard(int course)
 {
     return(keyboards.GetGroupsOfCourseKeyboard(course));
 }