From 45cd83fb698dee1668d67dc57345fec0553056a9 Mon Sep 17 00:00:00 2001 From: appelemac Date: Thu, 5 May 2016 11:50:15 +0200 Subject: [PATCH 1/4] Limit amount of Currency displayed when using $$$ --- NadekoBot/Modules/Gambling/GamblingModule.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NadekoBot/Modules/Gambling/GamblingModule.cs b/NadekoBot/Modules/Gambling/GamblingModule.cs index ae8c1cf0..7fd8c6dd 100644 --- a/NadekoBot/Modules/Gambling/GamblingModule.cs +++ b/NadekoBot/Modules/Gambling/GamblingModule.cs @@ -123,10 +123,17 @@ namespace NadekoBot.Modules.Gambling { var pts = GetUserFlowers(e.User.Id); var str = $"`You have {pts} {NadekoBot.Config.CurrencyName}s".SnPl((int)pts) + "`\n"; - for (var i = 0; i < pts; i++) + //Maximum displayed will be ~40 + int i; + for (i = 0;i < pts && i< 40; i++) { str += NadekoBot.Config.CurrencySign; } + if (i Date: Thu, 5 May 2016 11:56:13 +0200 Subject: [PATCH 2/4] Update FlowersHandler.cs --- NadekoBot/Classes/FlowersHandler.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NadekoBot/Classes/FlowersHandler.cs b/NadekoBot/Classes/FlowersHandler.cs index f05ce474..516ba63e 100644 --- a/NadekoBot/Classes/FlowersHandler.cs +++ b/NadekoBot/Classes/FlowersHandler.cs @@ -22,10 +22,17 @@ namespace NadekoBot.Classes return; var flows = ""; - for (var i = 0; i < amount; i++) + //Maximum displayed will be ~40 + int i; + for (i = 0; i < 40 && i < amount; i++) { flows += NadekoBot.Config.CurrencySign; } + if (i < amount) + { + flows += $" and {amount - i} more {NadekoBot.Config.CurrencySign}!"; + } + await u.SendMessage("đŸ‘‘Congratulations!đŸ‘‘\nYou received: " + flows).ConfigureAwait(false); } From 0a01500296f1490d13554f61da8a67d22a3e185e Mon Sep 17 00:00:00 2001 From: appelemac Date: Thu, 5 May 2016 15:49:10 +0200 Subject: [PATCH 3/4] changed format --- NadekoBot/Modules/Gambling/GamblingModule.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/NadekoBot/Modules/Gambling/GamblingModule.cs b/NadekoBot/Modules/Gambling/GamblingModule.cs index 7fd8c6dd..24e32377 100644 --- a/NadekoBot/Modules/Gambling/GamblingModule.cs +++ b/NadekoBot/Modules/Gambling/GamblingModule.cs @@ -122,18 +122,7 @@ namespace NadekoBot.Modules.Gambling return async e => { var pts = GetUserFlowers(e.User.Id); - var str = $"`You have {pts} {NadekoBot.Config.CurrencyName}s".SnPl((int)pts) + "`\n"; - //Maximum displayed will be ~40 - int i; - for (i = 0;i < pts && i< 40; i++) - { - str += NadekoBot.Config.CurrencySign; - } - if (i Date: Thu, 5 May 2016 15:52:08 +0200 Subject: [PATCH 4/4] changed format --- NadekoBot/Classes/FlowersHandler.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/NadekoBot/Classes/FlowersHandler.cs b/NadekoBot/Classes/FlowersHandler.cs index 516ba63e..86e4086b 100644 --- a/NadekoBot/Classes/FlowersHandler.cs +++ b/NadekoBot/Classes/FlowersHandler.cs @@ -21,17 +21,7 @@ namespace NadekoBot.Classes if (silent) return; - var flows = ""; - //Maximum displayed will be ~40 - int i; - for (i = 0; i < 40 && i < amount; i++) - { - flows += NadekoBot.Config.CurrencySign; - } - if (i < amount) - { - flows += $" and {amount - i} more {NadekoBot.Config.CurrencySign}!"; - } + var flows = amount +" " + NadekoBot.Config.CurrencySign; await u.SendMessage("đŸ‘‘Congratulations!đŸ‘‘\nYou received: " + flows).ConfigureAwait(false); }