mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-24 15:04:03 +00:00
Make use of the required keyword
This commit is contained in:
@@ -16,7 +16,7 @@ public abstract class TokenCommandBase : ICommand
|
||||
EnvironmentVariable = "DISCORD_TOKEN",
|
||||
Description = "Authentication token."
|
||||
)]
|
||||
public string Token { get; init; } = "";
|
||||
public required string Token { get; init; }
|
||||
|
||||
[Obsolete("This option doesn't do anything. Kept for backwards compatibility.")]
|
||||
[CommandOption(
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ExportChannelsCommand : ExportCommandBase
|
||||
IsRequired = true,
|
||||
Description = "Channel ID(s)."
|
||||
)]
|
||||
public IReadOnlyList<Snowflake> ChannelIds { get; init; } = Array.Empty<Snowflake>();
|
||||
public required IReadOnlyList<Snowflake> ChannelIds { get; init; }
|
||||
|
||||
public override async ValueTask ExecuteAsync(IConsole console)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ExportGuildCommand : ExportCommandBase
|
||||
IsRequired = true,
|
||||
Description = "Guild ID."
|
||||
)]
|
||||
public Snowflake GuildId { get; init; }
|
||||
public required Snowflake GuildId { get; init; }
|
||||
|
||||
public override async ValueTask ExecuteAsync(IConsole console)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ public class GetChannelsCommand : TokenCommandBase
|
||||
IsRequired = true,
|
||||
Description = "Guild ID."
|
||||
)]
|
||||
public Snowflake GuildId { get; init; }
|
||||
public required Snowflake GuildId { get; init; }
|
||||
|
||||
public override async ValueTask ExecuteAsync(IConsole console)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user