diff --git a/DiscordDelete/Program.cs b/DiscordDelete/Program.cs index 1e6c65b..4ecd3c9 100644 --- a/DiscordDelete/Program.cs +++ b/DiscordDelete/Program.cs @@ -66,11 +66,10 @@ int finalCode = await CommandLine }, async (ScanOptions opt) => { - // This should never happen author required. if (opt.Author is null) { - Console.WriteLine("Author ID is null."); - return 1; + Console.WriteLine("Author ID is null. Default to this user being author."); + opt.Author = client.MyDiscordId; } int totalMessages = 1; diff --git a/DiscordDelete/ScanOptions.cs b/DiscordDelete/ScanOptions.cs index 124d295..db1bf2c 100644 --- a/DiscordDelete/ScanOptions.cs +++ b/DiscordDelete/ScanOptions.cs @@ -15,7 +15,7 @@ namespace DiscordDelete [Option('c', "channel", ResourceType = typeof(string))] public string? ChannelId { get; set; } - [Option('a', "author", Required = true, ResourceType = typeof(string))] + [Option('a', "author", Required = false, ResourceType = typeof(string), Default = null)] public string? Author { get; set; } } }