fixed spam while playing $br

This commit is contained in:
Kwoth 2016-07-17 13:08:24 +02:00
parent 89de5e519b
commit b9d60d9c0e
2 changed files with 6 additions and 3 deletions

View File

@ -26,7 +26,7 @@ namespace NadekoBot.Classes
await u.SendMessage("👑Congratulations!👑\nYou received: " + flows).ConfigureAwait(false); await u.SendMessage("👑Congratulations!👑\nYou received: " + flows).ConfigureAwait(false);
} }
public static async Task<bool> RemoveFlowers(Discord.User u, string reason, int amount) public static async Task<bool> RemoveFlowers(Discord.User u, string reason, int amount, bool silent=false, string message="👎`Bot owner has taken {0}{1} from you.`")
{ {
if (amount <= 0) if (amount <= 0)
return false; return false;
@ -43,7 +43,10 @@ namespace NadekoBot.Classes
Value = -amount, 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; return true;
} }
} }

View File

@ -156,7 +156,7 @@ namespace NadekoBot.Modules.Gambling
return; 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 rng = new Random().Next(0, 101);
var str = $"{e.User.Mention} `You rolled {rng}.` "; var str = $"{e.User.Mention} `You rolled {rng}.` ";