mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
.xpadd will now work on roles
This commit is contained in:
@@ -726,6 +726,17 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
|
||||
// });
|
||||
// }
|
||||
|
||||
public async Task<int> AddXpToUsersAsync(ulong guildId, long amount, params ulong[] userIds)
|
||||
{
|
||||
await using var ctx = _db.GetDbContext();
|
||||
return await ctx.GetTable<UserXpStats>()
|
||||
.Where(x => x.GuildId == guildId && userIds.Contains(x.UserId))
|
||||
.UpdateAsync(old => new()
|
||||
{
|
||||
Xp = old.Xp + amount
|
||||
});
|
||||
}
|
||||
|
||||
public void AddXp(ulong userId, ulong guildId, int amount)
|
||||
{
|
||||
using var uow = _db.GetDbContext();
|
||||
|
Reference in New Issue
Block a user