Merge branch 'wip' into 1.9
This commit is contained in:
@ -9,5 +9,6 @@ namespace NadekoBot.Core.Services.Database.Repositories
|
||||
long GetUserCurrency(ulong userId);
|
||||
bool TryUpdateState(ulong userId, long change);
|
||||
IEnumerable<Currency> GetTopRichest(int count, int skip);
|
||||
void RemoveFromMany(List<long> ids);
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,11 @@ namespace NadekoBot.Core.Services.Database.Repositories.Impl
|
||||
public long GetUserCurrency(ulong userId) =>
|
||||
GetOrCreate(userId).Amount;
|
||||
|
||||
public void RemoveFromMany(List<long> ids)
|
||||
{
|
||||
_set.RemoveRange(_set.Where(x => ids.Contains((long)x.UserId)));
|
||||
}
|
||||
|
||||
public bool TryUpdateState(ulong userId, long change)
|
||||
{
|
||||
var cur = GetOrCreate(userId);
|
||||
|
@ -6,11 +6,14 @@ namespace NadekoBot.Core.Services.Impl
|
||||
public class BotConfigProvider : IBotConfigProvider
|
||||
{
|
||||
private readonly DbService _db;
|
||||
private readonly IDataCache _cache;
|
||||
|
||||
public BotConfig BotConfig { get; private set; }
|
||||
|
||||
public BotConfigProvider(DbService db, BotConfig bc)
|
||||
public BotConfigProvider(DbService db, BotConfig bc, IDataCache cache)
|
||||
{
|
||||
_db = db;
|
||||
_cache = cache;
|
||||
BotConfig = bc;
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ namespace NadekoBot
|
||||
{
|
||||
AllGuildConfigs = uow.GuildConfigs.GetAllGuildConfigs(startingGuildIdList).ToImmutableArray();
|
||||
|
||||
IBotConfigProvider botConfigProvider = new BotConfigProvider(_db, _botConfig);
|
||||
IBotConfigProvider botConfigProvider = new BotConfigProvider(_db, _botConfig, Cache);
|
||||
|
||||
//initialize Services
|
||||
Services = new NServiceProvider()
|
||||
|
Reference in New Issue
Block a user