Add safesearch to .img when using google

This commit is contained in:
ZeroNyan
2022-01-05 02:28:58 +00:00
committed by Kwoth
parent 71d383c4db
commit af343ac1f0

View File

@@ -1,4 +1,4 @@
using Google;
using Google;
using Google.Apis.Customsearch.v1;
using Google.Apis.Services;
using Google.Apis.Urlshortener.v1;
@@ -220,6 +220,7 @@ namespace NadekoBot.Services
req.Fields = "items(image(contextLink,thumbnailLink),link)";
req.SearchType = CseResource.ListRequest.SearchTypeEnum.Image;
req.Start = new NadekoRandom().Next(0, 20);
req.Safe = CseResource.ListRequest.SafeEnum.Active;
var search = await req.ExecuteAsync().ConfigureAwait(false);
@@ -388,4 +389,4 @@ namespace NadekoBot.Services
return mode;
}
}
}
}