From af343ac1f0818af48931510984626ae76f6b6a48 Mon Sep 17 00:00:00 2001 From: ZeroNyan Date: Wed, 5 Jan 2022 02:28:58 +0000 Subject: [PATCH] Add safesearch to .img when using google --- src/NadekoBot/Services/Impl/GoogleApiService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Services/Impl/GoogleApiService.cs b/src/NadekoBot/Services/Impl/GoogleApiService.cs index aa666ddf8..a5f408290 100644 --- a/src/NadekoBot/Services/Impl/GoogleApiService.cs +++ b/src/NadekoBot/Services/Impl/GoogleApiService.cs @@ -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; } } -} \ No newline at end of file +}