fix !google

This commit is contained in:
runebaas 2018-05-04 00:59:49 +02:00
parent 290b85fdb6
commit 0b7303d576
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
3 changed files with 4 additions and 4 deletions

View file

@ -48,13 +48,13 @@ namespace Geekbot.net.Commands.Integrations.Google
return; return;
} }
var data = response.ItemListElement.First().ResultDto; var data = response.ItemListElement.First().Result;
var eb = new EmbedBuilder(); var eb = new EmbedBuilder();
eb.Title = data.Name; eb.Title = data.Name;
if(!string.IsNullOrEmpty(data.Description)) eb.WithDescription(data.Description); if(!string.IsNullOrEmpty(data.Description)) eb.WithDescription(data.Description);
if(!string.IsNullOrEmpty(data.DetailedDtoDescription?.Url)) eb.WithUrl(data.DetailedDtoDescription.Url); if(!string.IsNullOrEmpty(data.DetailedDtoDescription?.Url)) eb.WithUrl(data.DetailedDtoDescription.Url);
if(!string.IsNullOrEmpty(data.DetailedDtoDescription?.ArticleBody)) eb.AddField("Details", data.DetailedDtoDescription.ArticleBody); if(!string.IsNullOrEmpty(data.DetailedDtoDescription?.ArticleBody)) eb.AddField("Details", data.DetailedDtoDescription.ArticleBody);
if(!string.IsNullOrEmpty(data.ImageDto?.ContentUrl)) eb.WithThumbnailUrl(data.ImageDto.ContentUrl); if(!string.IsNullOrEmpty(data.Image?.ContentUrl)) eb.WithThumbnailUrl(data.Image.ContentUrl);
await ReplyAsync("", false, eb.Build()); await ReplyAsync("", false, eb.Build());
} }

View file

@ -2,7 +2,7 @@
{ {
public class GoogleKgApiElementDto public class GoogleKgApiElementDto
{ {
public GoogleKgApiResultDto ResultDto { get; set; } public GoogleKgApiResultDto Result { get; set; }
public double ResultScore { get; set; } public double ResultScore { get; set; }
} }
} }

View file

@ -4,7 +4,7 @@
{ {
public string Name { get; set; } public string Name { get; set; }
public string Description { get; set; } public string Description { get; set; }
public GoogleKgApiImageDto ImageDto { get; set; } public GoogleKgApiImageDto Image { get; set; }
public GoogleKgApiDetailedDto DetailedDtoDescription { get; set; } public GoogleKgApiDetailedDto DetailedDtoDescription { get; set; }
} }
} }