コード例 #1
0
        public async Task <IActionResult> GetMainMenu([FromQuery(Name = "From")] string fromPhoneNumber)
        {
            var user = await _userService.GetByPhoneNumberOrCreateAsync(fromPhoneNumber);

            var currentChapter = _bibleMetadataService.GetChapterByNumber(user.ChapterNumber);
            var nextChapter    = _bibleMetadataService.GetChapterAfter(currentChapter);

            return(new TwilioResponseResult(x =>
            {
                x.BeginGather(new { numDigits = 1 });
                x.AliceSay("Main Menu");
                x.AliceSay(string.Format("Press 1 to hear {0}.", currentChapter));
                x.AliceSay(string.Format("Press 2 to hear {0}.", nextChapter));
                x.AliceSay("Press 3 to choose a different chapter.");
                x.AliceSay("Press 4 to choose a translation.");
                //x.AliceSay("Press 5 to set a daily text message reminder.");
                x.EndGather();
                x.Redirect(TwilioVoiceRoutes.MainMenu, "get");
            }));
        }