diff --git a/JetKarmaBot/Db.cs b/JetKarmaBot/Services/Db.cs similarity index 96% rename from JetKarmaBot/Db.cs rename to JetKarmaBot/Services/Db.cs index a32d44a..0868bd3 100644 --- a/JetKarmaBot/Db.cs +++ b/JetKarmaBot/Services/Db.cs @@ -57,7 +57,7 @@ namespace JetKarmaBot public byte GetAwardTypeId(string name) => AwardTypesByCommandName.GetOrDefault(name)?.AwardTypeId ?? DefaultAwardTypeId; - public bool AddAward(byte awardTypeId, long fromId, long toId, long chatId) + public bool AddAward(byte awardTypeId, long fromId, long toId, long chatId, int amount) { AddChat(new Chat() { ChatId = chatId }); AddUser(new User() { UserId = fromId}); @@ -67,8 +67,8 @@ namespace JetKarmaBot @"INSERT INTO award (chatid, fromid, toid, awardtypeid, amount) VALUES - (@chatId, @fromId, @toId, @awardTypeId, 1)", - new { awardTypeId, fromId, toId, chatId }); + (@chatId, @fromId, @toId, @awardTypeId, @amount)", + new { awardTypeId, fromId, toId, chatId, amount }); return affected == 1; }