diff --git a/src/NadekoBot/Modules/Help/Help.cs b/src/NadekoBot/Modules/Help/Help.cs index b0e1338b..73f10f05 100644 --- a/src/NadekoBot/Modules/Help/Help.cs +++ b/src/NadekoBot/Modules/Help/Help.cs @@ -88,16 +88,35 @@ namespace NadekoBot.Modules.Help if (com == null) { - await channel.SendMessageAsync("🔍 **I can't find that command.**"); + //await channel.SendMessageAsync("🔍 **I can't find that command.**"); + var erro = new EmbedBuilder() + .WithAuthor(eau => eau.WithName("Sorry!") + .WithUrl("http://nadekobot.readthedocs.io/en/latest/Commands%20List/") + .WithIconUrl(NadekoBot.Client.GetCurrentUser().AvatarUrl)) + //.WithTitle("Sorry!") + .WithDescription("I can't find that command. Please check the **command** and **command prefix** before trying again.") + .WithColor(NadekoBot.ErrorColor); + await channel.EmbedAsync(erro.Build()); return; } - var str = $"**__Help for:__ `{com.Text}`**"; + var str = $"{com.Text}"; var alias = com.Aliases.Skip(1).FirstOrDefault(); if (alias != null) str += $" / `{alias}`"; + var embed = new EmbedBuilder() + .WithAuthor(eau => eau.WithName("Help") + .WithUrl("http://nadekobot.readthedocs.io/en/latest/Commands%20List/") + .WithIconUrl(NadekoBot.Client.GetCurrentUser().AvatarUrl)) + //.WithTitle(str) + //.WithDescription($"{ string.Format(com.Summary, com.Module.Prefix)}{ GetCommandRequirements(com)}") + .AddField(fb => fb.WithIndex(1).WithName("**Command**").WithValue(str).WithIsInline(true)) + .AddField(fb => fb.WithIndex(2).WithName("**Usage**").WithValue($"{string.Format(com.Remarks, com.Module.Prefix)}").WithIsInline(true)) + .AddField(fb => fb.WithIndex(3).WithName("Description").WithValue($"{ string.Format(com.Summary, com.Module.Prefix)}{ GetCommandRequirements(com)}").WithIsInline(false)) + .WithColor(NadekoBot.OkColor); if (com != null) - await channel.SendMessageAsync(str + $@"{Environment.NewLine}**Desc:** {string.Format(com.Summary, com.Module.Prefix)} {GetCommandRequirements(com)} -**Usage:** {string.Format(com.Remarks, com.Module.Prefix)}").ConfigureAwait(false); + await channel.EmbedAsync(embed.Build()).ConfigureAwait(false); + //await channel.SendMessageAsync(str + $@"{Environment.NewLine}**Desc:** {string.Format(com.Summary, com.Module.Prefix)} {GetCommandRequirements(com)} +//**Usage:** {string.Format(com.Remarks, com.Module.Prefix)}").ConfigureAwait(false); } private string GetCommandRequirements(Command cmd) diff --git a/src/NadekoBot/Modules/Searches/Commands/StreamNotificationCommands.cs b/src/NadekoBot/Modules/Searches/Commands/StreamNotificationCommands.cs index e038a9d8..245081b4 100644 --- a/src/NadekoBot/Modules/Searches/Commands/StreamNotificationCommands.cs +++ b/src/NadekoBot/Modules/Searches/Commands/StreamNotificationCommands.cs @@ -303,10 +303,10 @@ namespace NadekoBot.Modules.Searches } if (!removed) { - await channel.SendMessageAsync(":anger: No such stream.").ConfigureAwait(false); + await channel.SendMessageAsync("❎ No such stream.").ConfigureAwait(false); return; } - await channel.SendMessageAsync($":ok: Removed `{username}`'s stream ({type}) from notifications.").ConfigureAwait(false); + await channel.SendMessageAsync($"🗑 Removed `{username}`'s stream ({type}) from notifications.").ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] @@ -358,7 +358,7 @@ namespace NadekoBot.Modules.Searches } catch { - await channel.SendMessageAsync(":anger: Stream probably doesn't exist.").ConfigureAwait(false); + await channel.SendMessageAsync("💢 Stream probably doesn't exist.").ConfigureAwait(false); return; } @@ -370,7 +370,7 @@ namespace NadekoBot.Modules.Searches await uow.CompleteAsync().ConfigureAwait(false); } - var msg = $":ok: I will notify this channel when status changes."; + var msg = $"🆗 I will notify this channel when status changes."; await channel.EmbedAsync(fs.GetEmbed(status).Build(), msg).ConfigureAwait(false); } } @@ -407,4 +407,4 @@ namespace NadekoBot.Modules.Searches return "??"; } } -} \ No newline at end of file +} diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 3154e9aa..904a7b1f 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -48,9 +48,9 @@ namespace NadekoBot.Modules.Searches .AddField(fb => fb.WithName("📏 Lat,Long").WithValue($"{obj["latitude"]}, {obj["longitude"]}").WithIsInline(true)) .AddField(fb => fb.WithName("☁ Condition").WithValue($"{obj["condition"]}").WithIsInline(true)) .AddField(fb => fb.WithName("😓 Humidity").WithValue($"{obj["humidity"]}%").WithIsInline(true)) - .AddField(fb => fb.WithName("💨 Wind Speed").WithValue($"{obj["windspeedk"]}km/h / {obj["windspeedm"]}mph").WithIsInline(true)) - .AddField(fb => fb.WithName("🌡 Temperature").WithValue($"{obj["centigrade"]}°C / {obj["fahrenheit"]}°F").WithIsInline(true)) - .AddField(fb => fb.WithName("🔆 Feels like").WithValue($"{obj["feelscentigrade"]}°C / {obj["feelsfahrenheit"]}°F").WithIsInline(true)) + .AddField(fb => fb.WithName("💨 Wind Speed").WithValue($"{obj["windspeedk"]}km/h ({obj["windspeedm"]}mph)").WithIsInline(true)) + .AddField(fb => fb.WithName("🌡 Temperature").WithValue($"{obj["centigrade"]}°C ({obj["fahrenheit"]}°F)").WithIsInline(true)) + .AddField(fb => fb.WithName("🔆 Feels like").WithValue($"{obj["feelscentigrade"]}°C ({obj["feelsfahrenheit"]}°F)").WithIsInline(true)) .AddField(fb => fb.WithName("🌄 Sunrise").WithValue($"{obj["sunrise"]}").WithIsInline(true)) .AddField(fb => fb.WithName("🌇 Sunset").WithValue($"{obj["sunset"]}").WithIsInline(true)) .WithColor(NadekoBot.OkColor); @@ -313,6 +313,50 @@ namespace NadekoBot.Modules.Searches } } + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + public async Task Yodify(IUserMessage umsg, [Remainder] string query = null) + { + var channel = (ITextChannel)umsg.Channel; + + if (string.IsNullOrWhiteSpace(NadekoBot.Credentials.MashapeKey)) + { + await channel.SendMessageAsync("💢 `Bot owner didn't specify MashapeApiKey. You can't use this functionality.`").ConfigureAwait(false); + return; + } + + var arg = query; + if (string.IsNullOrWhiteSpace(arg)) + { + await channel.SendMessageAsync("💢 `Please enter a sentence.`").ConfigureAwait(false); + return; + } + await umsg.Channel.TriggerTypingAsync().ConfigureAwait(false); + using (var http = new HttpClient()) + { + http.DefaultRequestHeaders.Clear(); + http.DefaultRequestHeaders.Add("X-Mashape-Key", NadekoBot.Credentials.MashapeKey); + http.DefaultRequestHeaders.Add("Accept", "text/plain"); + var res = await http.GetStringAsync($"https://yoda.p.mashape.com/yoda?sentence={Uri.EscapeUriString(arg)}").ConfigureAwait(false); + try + { + var embed = new EmbedBuilder() + .WithTitle("Young Padawan") + .WithUrl("http://www.yodaspeak.co.uk/") + .WithAuthor(au => au.WithName("Yoda").WithIconUrl("http://www.yodaspeak.co.uk/yoda-small1.gif")) + .WithDescription("Seek advice, you must!") + .WithThumbnail(th => th.WithUrl("http://i.imgur.com/62Uh4u6.jpg")) + .AddField(fb => fb.WithName($"🌍 **{umsg.Author.Username}**").WithValue($"{res.ToString()}").WithIsInline(false)) + .WithColor(NadekoBot.OkColor); + await channel.EmbedAsync(embed.Build()).ConfigureAwait(false); + } + catch + { + await channel.SendMessageAsync("💢 Failed to yodify your sentence.").ConfigureAwait(false); + } + } + } + [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] public async Task UrbanDict(IUserMessage umsg, [Remainder] string query = null) diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index 2dac6f90..4e479ab8 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -222,7 +222,7 @@ namespace NadekoBot.Modules.Utility }, }, - Color = NadekoBot.OkColor + Color = 0x00bbd6 }); } diff --git a/src/NadekoBot/NadekoBot.cs b/src/NadekoBot/NadekoBot.cs index a0d80f36..e110a8e2 100644 --- a/src/NadekoBot/NadekoBot.cs +++ b/src/NadekoBot/NadekoBot.cs @@ -24,8 +24,8 @@ namespace NadekoBot { private Logger _log; - public static uint OkColor { get; } = 0x00ff00; - public static uint ErrorColor { get; } = 0xff0000; + public static uint OkColor { get; } = 0x71cd40; + public static uint ErrorColor { get; } = 0xee281f; public static CommandService CommandService { get; private set; } public static CommandHandler CommandHandler { get; private set; } diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index d6568b6e..9bee88cc 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -7781,6 +7781,33 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to yodify yoda. + /// + public static string yodify_cmd { + get { + return ResourceManager.GetString("yodify_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Translates your normal sentences into Yoda styled sentences!. + /// + public static string yodify_desc { + get { + return ResourceManager.GetString("yodify_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}yodify I was once an adventurer like you` or `{0}yoda my feelings hurt`. + /// + public static string yodify_usage { + get { + return ResourceManager.GetString("yodify_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to yomama ym. /// diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index dc97bd25..26c79ade 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -2709,4 +2709,13 @@ `{0}magicthegathering about face` or `{0}mtg about face` + + yodify yoda + + + Translates your normal sentences into Yoda styled sentences! + + + {0}yodify I was once an adventurer like you` or `{0}yoda my feelings hurt` + \ No newline at end of file