NadekoFlowers, fix
This commit is contained in:
parent
8009b8e995
commit
bfc3acd40d
@ -7,6 +7,8 @@ using System.Threading.Tasks;
|
|||||||
namespace NadekoBot.Classes {
|
namespace NadekoBot.Classes {
|
||||||
static class FlowersHandler {
|
static class FlowersHandler {
|
||||||
public static async Task AddFlowersAsync(Discord.User u, string reason, int amount) {
|
public static async Task AddFlowersAsync(Discord.User u, string reason, int amount) {
|
||||||
|
if (amount <= 0)
|
||||||
|
return;
|
||||||
await Task.Run(() => {
|
await Task.Run(() => {
|
||||||
DBHandler.Instance.InsertData(new _DataModels.CurrencyTransaction {
|
DBHandler.Instance.InsertData(new _DataModels.CurrencyTransaction {
|
||||||
Reason = reason,
|
Reason = reason,
|
||||||
@ -14,7 +16,11 @@ namespace NadekoBot.Classes {
|
|||||||
Value = amount,
|
Value = amount,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await u.SendMessage("👑Congratulations!👑\nYou got: 🌸🌸");
|
string flows = "";
|
||||||
|
for (int i = 0; i < amount; i++) {
|
||||||
|
flows += "🌸";
|
||||||
|
}
|
||||||
|
await u.SendMessage("👑Congratulations!👑\nYou got: "+flows);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,10 +49,10 @@ namespace NadekoBot.Modules
|
|||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
cgb.CreateCommand("$$$")
|
cgb.CreateCommand("$$$")
|
||||||
.Description("Check how many NadekoPoints you have.")
|
.Description("Check how many NadekoFlowers you have.")
|
||||||
.Do(async e => {
|
.Do(async e => {
|
||||||
var pts = Classes.DBHandler.Instance.GetStateByUserId((long)e.User.Id)?.Value ?? 0;
|
var pts = Classes.DBHandler.Instance.GetStateByUserId((long)e.User.Id)?.Value ?? 0;
|
||||||
string str = $"`You have {pts} NadekoPoints".SnPl((int)pts)+"`\n";
|
string str = $"`You have {pts} NadekoFlowers".SnPl((int)pts)+"`\n";
|
||||||
for (int i = 0; i < pts; i++) {
|
for (int i = 0; i < pts; i++) {
|
||||||
str += "🌸";
|
str += "🌸";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user