mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 15:53:30 -07:00
[CLI] Use environment variable fallbacks for token
This commit is contained in:
parent
ca7fc4d8d1
commit
d74e6453f6
|
|
@ -10,10 +10,12 @@ namespace DiscordChatExporter.Cli.Commands
|
||||||
{
|
{
|
||||||
protected DataService DataService { get; }
|
protected DataService DataService { get; }
|
||||||
|
|
||||||
[CommandOption("token", 't', IsRequired = true, Description = "Authorization token.")]
|
[CommandOption("token", 't', IsRequired = true, EnvironmentVariableName = "DISCORD_TOKEN",
|
||||||
|
Description = "Authorization token.")]
|
||||||
public string TokenValue { get; set; } = "";
|
public string TokenValue { get; set; } = "";
|
||||||
|
|
||||||
[CommandOption("bot", 'b', Description = "Whether this authorization token belongs to a bot.")]
|
[CommandOption("bot", 'b', EnvironmentVariableName = "DISCORD_TOKEN_BOT",
|
||||||
|
Description = "Whether this authorization token belongs to a bot.")]
|
||||||
public bool IsBotToken { get; set; }
|
public bool IsBotToken { get; set; }
|
||||||
|
|
||||||
protected AuthToken Token => new AuthToken(IsBotToken ? AuthTokenType.Bot : AuthTokenType.User, TokenValue);
|
protected AuthToken Token => new AuthToken(IsBotToken ? AuthTokenType.Bot : AuthTokenType.User, TokenValue);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue