示例#1
0
        public async Task GetForecast(
            [Summary("The location you want to check the forecast for")][Remainder] string location = "")
        {
            EmbedBuilder embed;

            if (location == String.Empty)
            {
                var user = await FindUserAsync();

                if (user.City == null)
                {
                    embed = await service.NotLinkedError();
                    await ReplyAsync("", embed : embed.Build());

                    return;
                }
                location = user.City;

                try
                {
                    embed = await service.Forecast(location);
                }
                catch (RuntimeBinderException)
                {
                    embed = await service.NoInformation();
                }

                await ReplyAsync("", embed : embed);

                return;
            }

            embed = await service.Forecast(location);
            await ReplyAsync("", embed : embed.Build());
        }