Refactor data stores, merging the Store classes

This commit is contained in:
Ske
2019-10-26 19:45:30 +02:00
parent 1ab84b54dd
commit 6a73b3bdd6
21 changed files with 540 additions and 338 deletions

View File

@@ -7,10 +7,10 @@ namespace PluralKit.Bot.Commands
{
public class APICommands
{
private SystemStore _systems;
public APICommands(SystemStore systems)
private IDataStore _data;
public APICommands(IDataStore data)
{
_systems = systems;
_data = data;
}
public async Task GetToken(Context ctx)
@@ -34,7 +34,7 @@ namespace PluralKit.Bot.Commands
private async Task<string> MakeAndSetNewToken(PKSystem system)
{
system.Token = PluralKit.Utils.GenerateToken();
await _systems.Save(system);
await _data.SaveSystem(system);
return system.Token;
}