示例#1
0
        public async Task AuthAsync()
        {
            // before we begin, check if the pre-reqs are met
            if (!GoogleCalendarSyncService.DoesGoogleAPIClientIDFileExist())
            {
                await ReplyAsync(
                    $"We can't find some things we need for this to work. " +
                    $"Contact {Context.Guild.GetUser(ulong.Parse(Config["discordBotOwnerId"])).Mention} (client_id.json file missing). " +
                    $"When that's resolved, run the ```{Config["prefix"]}auth``` command to continue the process.");

                return;
            }

            await GoogleCalendarSyncService.GetAuthCode(Context);

            var response = await NextMessageAsync(true, true, TimeSpan.FromSeconds(60));

            if (response != null)
            {
                await GoogleCalendarSyncService.GetTokenAndLogin(response.Content, Context);
            }
            else
            {
                await ReplyAsync("I didn't get a response in time. Try again.");
            }
        }
        public async Task AuthAsync()
        {
            await GoogleCalendarSyncService.GetAuthCode(Context);

            var response = await NextMessageAsync(true, true, TimeSpan.FromSeconds(60));

            if (response != null)
            {
                await GoogleCalendarSyncService.GetTokenAndLogin(response.Content, Context);
            }
            else
            {
                await ReplyAsync("I didn't get a response in time. Try again.");
            }
        }