mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 00:30:11 +00:00
Refactor data stores, merging the Store classes
This commit is contained in:
parent
1ab84b54dd
commit
6a73b3bdd6
21 changed files with 540 additions and 338 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue