diff --git a/src/NadekoBot/Modules/NSFW/NSFW.cs b/src/NadekoBot/Modules/NSFW/NSFW.cs index e94a7f46..d5b1de03 100644 --- a/src/NadekoBot/Modules/NSFW/NSFW.cs +++ b/src/NadekoBot/Modules/NSFW/NSFW.cs @@ -111,17 +111,10 @@ namespace NadekoBot.Modules.NSFW { var webpage = await http.GetStringAsync(url).ConfigureAwait(false); var matches = Regex.Matches(webpage, "file_url=\"(?.*?)\""); - var rating = Regex.Matches(webpage, "rating=\"(?.*?)\""); + //var rating = Regex.Matches(webpage, "rating=\"(?.*?)\""); if (matches.Count == 0) return null; - if (string.Equals(rating[rng.Next(0, rating.Count)].Groups["rate"].Value.ToString(), "e") || string.Equals(rating[rng.Next(0, rating.Count)].Groups["rate"].Value.ToString(), "q")) - { - return matches[rng.Next(0, matches.Count)].Groups["url"].Value; - } - else - { - return null; - } + return matches[rng.Next(0, matches.Count)].Groups["url"].Value; } } diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 1dcb8f6e..19642917 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -385,20 +385,6 @@ $@"🌍 **Weather for** 【{obj["target"]}】 return; await channel.SendMessageAsync($"https://images.google.com/searchbyimage?image_url={imageLink}").ConfigureAwait(false); } - - [NadekoCommand, Usage, Description, Aliases] - [RequireContext(ContextType.Guild)] - public async Task Safeyandere(IUserMessage umsg, [Remainder] string tag = null) - { - var channel = (ITextChannel)umsg.Channel; - - tag = tag?.Trim() ?? ""; - var link = await GetSafeYandereImageLink(tag).ConfigureAwait(false); - if (link == null) - await channel.SendMessageAsync("`No results.`"); - else - await channel.SendMessageAsync(link).ConfigureAwait(false); - } [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] @@ -491,32 +477,6 @@ $@"🌍 **Weather for** 【{obj["target"]}】 } await channel.SendMessageAsync(await _google.ShortenUrl(usr.AvatarUrl).ConfigureAwait(false)).ConfigureAwait(false); } - - public static async Task GetSafeYandereImageLink(string tag) - { - var rng = new NadekoRandom(); - var url = - $"https://yande.re/post.xml?" + - $"limit=25" + - $"&page={rng.Next(0, 15)}" + - $"&tags={tag.Replace(" ", "_")}"; - using (var http = new HttpClient()) - { - var webpage = await http.GetStringAsync(url).ConfigureAwait(false); - var matches = Regex.Matches(webpage, "file_url=\"(?.*?)\""); - var rating = Regex.Matches(webpage, "rating=\"(?.*?)\""); - if (matches.Count == 0) - return null; - if (string.Equals(rating[rng.Next(0, rating.Count)].Groups["rate"].Value.ToString(), "s") || string.Equals(rating[rng.Next(0, rating.Count)].Groups["rate"].Value.ToString(), "q")) - { - return matches[rng.Next(0, matches.Count)].Groups["url"].Value; - } - else - { - return null; - } - } - } public static async Task GetSafebooruImageLink(string tag) { diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index b382641f..dec5bf12 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -6673,33 +6673,6 @@ namespace NadekoBot.Resources { return ResourceManager.GetString("stop_usage", resourceCulture); } } - - /// - /// Looks up a localized string similar to safeyandere sy. - /// - public static string safeyandere_cmd { - get { - return ResourceManager.GetString("sy_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Shows a safe random image from yandere with a given tag. Tag is optional but preferred. (multiple tags are appended with +). - /// - public static string safeyandere_desc { - get { - return ResourceManager.GetString("sy_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}sy tag1+tag2` or `{0}safeyandere tag1+tag2`. - /// - public static string safeyandere_usage { - get { - return ResourceManager.GetString("sy_usage", resourceCulture); - } - } /// /// Looks up a localized string similar to take. diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index a288e948..aa936b7d 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -2691,15 +2691,6 @@ `{0}bfu platform game user` - - safeyandere sy - - - Shows a safe random image from yandere with a given tag. Tag is optional but preferred. (multiple tags are appended with +) - - - `{0}sy tag1+tag2` or `{0}safeyandere tag1+tag2` - yandere