Flowers handler, moved currency granting over there
This commit is contained in:
parent
b3ef288a27
commit
8009b8e995
20
NadekoBot/Classes/FlowersHandler.cs
Normal file
20
NadekoBot/Classes/FlowersHandler.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace NadekoBot.Classes {
|
||||||
|
static class FlowersHandler {
|
||||||
|
public static async Task AddFlowersAsync(Discord.User u, string reason, int amount) {
|
||||||
|
await Task.Run(() => {
|
||||||
|
DBHandler.Instance.InsertData(new _DataModels.CurrencyTransaction {
|
||||||
|
Reason = reason,
|
||||||
|
UserId = (long)u.Id,
|
||||||
|
Value = amount,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
await u.SendMessage("👑Congratulations!👑\nYou got: 🌸🌸");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -11,7 +11,7 @@ namespace NadekoBot
|
|||||||
{
|
{
|
||||||
public class NadekoStats
|
public class NadekoStats
|
||||||
{
|
{
|
||||||
public string BotVersion = "0.8-beta8";
|
public string BotVersion = "0.8-beta9";
|
||||||
|
|
||||||
private static readonly NadekoStats _instance = new NadekoStats();
|
private static readonly NadekoStats _instance = new NadekoStats();
|
||||||
public static NadekoStats Instance => _instance;
|
public static NadekoStats Instance => _instance;
|
||||||
|
@ -112,14 +112,7 @@ namespace NadekoBot.Classes.Trivia {
|
|||||||
ShouldStopGame = true;
|
ShouldStopGame = true;
|
||||||
await _channel.Send($":exclamation: We have a winner! Its {e.User.Mention}.");
|
await _channel.Send($":exclamation: We have a winner! Its {e.User.Mention}.");
|
||||||
// add points to the winner
|
// add points to the winner
|
||||||
await Task.Run(async () => {
|
await FlowersHandler.AddFlowersAsync(e.User, "Won Trivia", 2);
|
||||||
DBHandler.Instance.InsertData(new _DataModels.CurrencyTransaction {
|
|
||||||
Reason = "Won Trivia",
|
|
||||||
UserId = (long)e.User.Id,
|
|
||||||
Value = 2,
|
|
||||||
});
|
|
||||||
await e.User.SendMessage("👑Congratulations!👑\nYou got: 🌸🌸");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user