If author isn't specified, assume author as this user.

This commit is contained in:
Filip Strajnar 2024-06-16 19:24:14 +02:00
parent 183c002bda
commit be5fd71935
2 changed files with 3 additions and 4 deletions

View file

@ -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;

View file

@ -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; }
}
}