Exemplo n.º 1
0
        public async Task Default([Remainder] string parameters = "")
        {
            CatApiResponse catApiResponse = await catApiRequestSender.SendRequestAsync(
                new CatApiRequest
            {
                Parameters = parameters.Split(' ').Select(x => x.Trim())
            });

            if (catApiResponse == null)
            {
                return;
            }

            string mediaUrl = catApiResponse.Url;

            if (!string.IsNullOrWhiteSpace(mediaUrl))
            {
                string breed = string.Empty;

                IList <JObject> breedsList = catApiResponse.Breeds.ToList();

                if (breedsList.Any())
                {
                    breed = $"Breed: {breedsList.FirstOrDefault()?["name"] ?? string.Empty}";
                }

                await ReplyAsync(embed : new EmbedBuilder().WithImageUrl(mediaUrl).WithFooter(breed).Build());
            }
        }
Exemplo n.º 2
0
        public async Task Login(LoginRequestDto loginRequest, Action finalAction)
        {
            // Send the login request
            var response = await _requestSender.SendRequestAsync(loginRequest, finalAction);

            await _localLoginService.LocalLogin(response.User, response.LoginToken);
        }