From cf5e89d6a23ce8fc962f7c106f7ae815503b4d28 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 10 Apr 2016 02:20:35 +0200 Subject: [PATCH] >heal and >plant are now correctly using currency name/sign. closes #202 --- NadekoBot/Commands/PlantPick.cs | 8 ++++---- NadekoBot/Modules/Pokemon/PokemonModule.cs | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NadekoBot/Commands/PlantPick.cs b/NadekoBot/Commands/PlantPick.cs index 8d688911..0f099514 100644 --- a/NadekoBot/Commands/PlantPick.cs +++ b/NadekoBot/Commands/PlantPick.cs @@ -70,13 +70,13 @@ namespace NadekoBot.Commands var file = Directory.GetFiles("data/currency_images").OrderBy(s => rng.Next()).FirstOrDefault(); Message msg; if (file == null) - msg = e.Channel.SendMessage("🌸").Result; + msg = e.Channel.SendMessage(NadekoBot.Config.CurrencySign).GetAwaiter().GetResult(); else - msg = e.Channel.SendFile(file).Result; + msg = e.Channel.SendFile(file).GetAwaiter().GetResult(); plantedFlowerChannels.TryAdd(e.Channel.Id, msg); } - - var msg2 = await e.Channel.SendMessage($"Oh how Nice! **{e.User.Name}** planted a flower. Pick it using {Module.Prefix}pick"); + var vowelFirst = new[] { 'a', 'e', 'i', 'o', 'u' }.Contains(NadekoBot.Config.CurrencyName[0]); + var msg2 = await e.Channel.SendMessage($"Oh how Nice! **{e.User.Name}** planted {(vowelFirst ? "an" : "a")} {NadekoBot.Config.CurrencyName}. Pick it using {Module.Prefix}pick"); await Task.Delay(20000); await msg2.Delete(); }); diff --git a/NadekoBot/Modules/Pokemon/PokemonModule.cs b/NadekoBot/Modules/Pokemon/PokemonModule.cs index b754a236..7da1d0f7 100644 --- a/NadekoBot/Modules/Pokemon/PokemonModule.cs +++ b/NadekoBot/Modules/Pokemon/PokemonModule.cs @@ -252,7 +252,8 @@ namespace NadekoBot.Modules.Pokemon await e.Channel.SendMessage($"{e.User.Name} revived {usr.Name} with one {NadekoBot.Config.CurrencySign}"); return; } - await e.Channel.SendMessage($"{e.User.Name} healed {usr.Name} for {targetStats.MaxHp - HP} HP with a 🌸"); + var vowelFirst = new[] { 'a', 'e', 'i', 'o', 'u' }.Contains(NadekoBot.Config.CurrencyName[0]); + await e.Channel.SendMessage($"{e.User.Name} healed {usr.Name} for {targetStats.MaxHp - HP} HP with {(vowelFirst ? "an" : "a")} {NadekoBot.Config.CurrencySign}"); return; } else