Add defaults to inits

pull/1125/head
Tyrrrz 1 year ago
parent eac974cfb1
commit 8236ba7c4d

@ -24,7 +24,7 @@ public abstract class DiscordCommandBase : ICommand
EnvironmentVariable = "DISCORD_TOKEN_BOT",
Description = "This option doesn't do anything. Kept for backwards compatibility."
)]
public bool IsBotToken { get; init; }
public bool IsBotToken { get; init; } = false;
private DiscordClient? _discordClient;
protected DiscordClient Discord => _discordClient ??= new DiscordClient(Token);

@ -94,13 +94,13 @@ public abstract class ExportCommandBase : DiscordCommandBase
"media",
Description = "Download assets referenced by the export (user avatars, attached files, embedded images, etc.)."
)]
public bool ShouldDownloadAssets { get; init; }
public bool ShouldDownloadAssets { get; init; } = false;
[CommandOption(
"reuse-media",
Description = "Reuse previously downloaded assets to avoid redundant requests."
)]
public bool ShouldReuseAssets { get; init; }
public bool ShouldReuseAssets { get; init; } = false;
private readonly string? _assetsDirPath;
@ -131,7 +131,7 @@ public abstract class ExportCommandBase : DiscordCommandBase
// Use a converter to accept '1' as 'true' to reuse the existing environment variable
Converter = typeof(TruthyBooleanBindingConverter)
)]
public bool IsUkraineSupportMessageDisabled { get; init; }
public bool IsUkraineSupportMessageDisabled { get; init; } = false;
private ChannelExporter? _channelExporter;
protected ChannelExporter Exporter => _channelExporter ??= new ChannelExporter(Discord);

Loading…
Cancel
Save