From ac6ad1d853219ca4b19d7e3c872139f5d3663ee6 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 3 Mar 2017 03:59:12 +0100 Subject: [PATCH] fixed nsfw string --- src/NadekoBot/Modules/NSFW/NSFW.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/NadekoBot/Modules/NSFW/NSFW.cs b/src/NadekoBot/Modules/NSFW/NSFW.cs index 6e72aefc..5f45af24 100644 --- a/src/NadekoBot/Modules/NSFW/NSFW.cs +++ b/src/NadekoBot/Modules/NSFW/NSFW.cs @@ -142,11 +142,11 @@ namespace NadekoBot.Modules.NSFW #endif [NadekoCommand, Usage, Description, Aliases] public Task Yandere([Remainder] string tag = null) - => InternalDapiCommand(Context.Message, tag, Searches.Searches.DapiSearchType.Yandere); + => InternalDapiCommand(tag, Searches.Searches.DapiSearchType.Yandere); [NadekoCommand, Usage, Description, Aliases] public Task Konachan([Remainder] string tag = null) - => InternalDapiCommand(Context.Message, tag, Searches.Searches.DapiSearchType.Konachan); + => InternalDapiCommand(tag, Searches.Searches.DapiSearchType.Konachan); [NadekoCommand, Usage, Description, Aliases] public async Task E621([Remainder] string tag = null) @@ -167,7 +167,7 @@ namespace NadekoBot.Modules.NSFW [NadekoCommand, Usage, Description, Aliases] public Task Rule34([Remainder] string tag = null) - => InternalDapiCommand(Context.Message, tag, Searches.Searches.DapiSearchType.Rule34); + => InternalDapiCommand(tag, Searches.Searches.DapiSearchType.Rule34); [NadekoCommand, Usage, Description, Aliases] public async Task Danbooru([Remainder] string tag = null) @@ -210,7 +210,7 @@ namespace NadekoBot.Modules.NSFW [NadekoCommand, Usage, Description, Aliases] public Task Gelbooru([Remainder] string tag = null) - => InternalDapiCommand(Context.Message, tag, Searches.Searches.DapiSearchType.Gelbooru); + => InternalDapiCommand(tag, Searches.Searches.DapiSearchType.Gelbooru); [NadekoCommand, Usage, Description, Aliases] public async Task Cp() @@ -288,19 +288,17 @@ namespace NadekoBot.Modules.NSFW public static Task GetGelbooruImageLink(string tag) => Searches.Searches.InternalDapiSearch(tag, Searches.Searches.DapiSearchType.Gelbooru); - public async Task InternalDapiCommand(IUserMessage umsg, string tag, Searches.Searches.DapiSearchType type) + public async Task InternalDapiCommand(string tag, Searches.Searches.DapiSearchType type) { - var channel = umsg.Channel; - tag = tag?.Trim() ?? ""; var url = await Searches.Searches.InternalDapiSearch(tag, type).ConfigureAwait(false); if (url == null) - await channel.SendErrorAsync(umsg.Author.Mention + " " + GetText("no_results")); + await ReplyErrorLocalized("not_found").ConfigureAwait(false); else - await channel.EmbedAsync(new EmbedBuilder().WithOkColor() - .WithDescription(umsg.Author.Mention + " " + tag) + await Context.Channel.EmbedAsync(new EmbedBuilder().WithOkColor() + .WithDescription(Context.User + " " + tag) .WithImageUrl(url) .WithFooter(efb => efb.WithText(type.ToString()))).ConfigureAwait(false); }