From b9d60d9c0edb470f5a12ab66e060048031bf8d41 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sun, 17 Jul 2016 13:08:24 +0200 Subject: [PATCH] fixed spam while playing $br --- NadekoBot/Classes/FlowersHandler.cs | 7 +++++-- NadekoBot/Modules/Gambling/GamblingModule.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NadekoBot/Classes/FlowersHandler.cs b/NadekoBot/Classes/FlowersHandler.cs index 4d7f3676..6fa042ea 100644 --- a/NadekoBot/Classes/FlowersHandler.cs +++ b/NadekoBot/Classes/FlowersHandler.cs @@ -26,7 +26,7 @@ namespace NadekoBot.Classes await u.SendMessage("👑Congratulations!👑\nYou received: " + flows).ConfigureAwait(false); } - public static async Task RemoveFlowers(Discord.User u, string reason, int amount) + public static async Task RemoveFlowers(Discord.User u, string reason, int amount, bool silent=false, string message="👎`Bot owner has taken {0}{1} from you.`") { if (amount <= 0) return false; @@ -43,7 +43,10 @@ namespace NadekoBot.Classes Value = -amount, }); - await u.SendMessage($"👎`Bot owner has taken:{amount}{NadekoBot.Config.CurrencySign} from you.`").ConfigureAwait(false); + if (silent) + return true; + + await u.SendMessage(string.Format(message,amount,NadekoBot.Config.CurrencySign)).ConfigureAwait(false); return true; } } diff --git a/NadekoBot/Modules/Gambling/GamblingModule.cs b/NadekoBot/Modules/Gambling/GamblingModule.cs index 9bf0b2a0..a9494715 100644 --- a/NadekoBot/Modules/Gambling/GamblingModule.cs +++ b/NadekoBot/Modules/Gambling/GamblingModule.cs @@ -156,7 +156,7 @@ namespace NadekoBot.Modules.Gambling return; } - await FlowersHandler.RemoveFlowers(e.User, "Betroll Gamble", (int)amount); + await FlowersHandler.RemoveFlowers(e.User, "Betroll Gamble", (int)amount, true); var rng = new Random().Next(0, 101); var str = $"{e.User.Mention} `You rolled {rng}.` ";