mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-03 08:39:14 +00:00
28 lines
918 B
C#
28 lines
918 B
C#
using System.Threading.Tasks;
|
|
using CliFx;
|
|
using CliFx.Attributes;
|
|
using DiscordChatExporter.Core.Models;
|
|
using DiscordChatExporter.Core.Services;
|
|
|
|
namespace DiscordChatExporter.Cli.Commands
|
|
{
|
|
public abstract class TokenCommandBase : ICommand
|
|
{
|
|
protected DataService DataService { get; }
|
|
|
|
[CommandOption("token", 't', IsRequired = true, Description = "Authorization token.")]
|
|
public string TokenValue { get; set; } = "";
|
|
|
|
[CommandOption("bot", 'b', Description = "Whether this authorization token belongs to a bot.")]
|
|
public bool IsBotToken { get; set; }
|
|
|
|
protected AuthToken Token => new AuthToken(IsBotToken ? AuthTokenType.Bot : AuthTokenType.User, TokenValue);
|
|
|
|
protected TokenCommandBase(DataService dataService)
|
|
{
|
|
DataService = dataService;
|
|
}
|
|
|
|
public abstract ValueTask ExecuteAsync(IConsole console);
|
|
}
|
|
} |