mirror of
https://github.com/Jetsparrow/karmabot.git
synced 2026-01-21 00:56:09 +03:00
create Services folder and move Db.cs into it
This commit is contained in:
parent
faa46ac628
commit
7ea5b180cb
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user