feat: rename Commands/Token to Commands/Api

This commit is contained in:
spiral 2021-11-03 01:36:03 -04:00
parent 71aec0d419
commit c1f05eecf8
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31
3 changed files with 5 additions and 5 deletions

View File

@ -9,11 +9,11 @@ using PluralKit.Core;
namespace PluralKit.Bot
{
public class Token
public class Api
{
private readonly IDatabase _db;
private readonly ModelRepository _repo;
public Token(IDatabase db, ModelRepository repo)
public Api(IDatabase db, ModelRepository repo)
{
_db = db;
_repo = repo;

View File

@ -152,9 +152,9 @@ namespace PluralKit.Bot
return ctx.Execute<SystemLink>(Unlink, m => m.UnlinkAccount(ctx));
if (ctx.Match("token"))
if (ctx.Match("refresh", "renew", "invalidate", "reroll", "regen"))
return ctx.Execute<Token>(TokenRefresh, m => m.RefreshToken(ctx));
return ctx.Execute<Api>(TokenRefresh, m => m.RefreshToken(ctx));
else
return ctx.Execute<Token>(TokenGet, m => m.GetToken(ctx));
return ctx.Execute<Api>(TokenGet, m => m.GetToken(ctx));
if (ctx.Match("import"))
return ctx.Execute<ImportExport>(Import, m => m.Import(ctx));
if (ctx.Match("export"))

View File

@ -68,6 +68,7 @@ namespace PluralKit.Bot
// Commands
builder.RegisterType<CommandTree>().AsSelf();
builder.RegisterType<Admin>().AsSelf();
builder.RegisterType<Api>().AsSelf();
builder.RegisterType<Autoproxy>().AsSelf();
builder.RegisterType<Checks>().AsSelf();
builder.RegisterType<Fun>().AsSelf();
@ -89,7 +90,6 @@ namespace PluralKit.Bot
builder.RegisterType<SystemFront>().AsSelf();
builder.RegisterType<SystemLink>().AsSelf();
builder.RegisterType<SystemList>().AsSelf();
builder.RegisterType<Token>().AsSelf();
// Bot core
builder.RegisterType<Bot>().AsSelf().SingleInstance();