Skip to content

Commit b408dd3

Browse files
committed
Fix crash in message commands
1 parent e2a0003 commit b408dd3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sanara/Module/Command/Context/MessageCommandContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public MessageCommandContext(IServiceProvider provider, IMessage message, string
3333
if (arg.IsRequired.Value)
3434
{
3535
var errorMsg = $"Missing required argument {arg.Name} of type {arg.Type}";
36-
if (arg.Choices.Any())
36+
if (arg.Choices?.Any() ?? false)
3737
{
3838
errorMsg += $"\n\nAvailable choices:\n{string.Join("\n", arg.Choices.Select(x => $"{x.Value}: {x.Name}"))}";
3939
}

Sanara/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ private async Task ButtonExecuted(SocketMessageComponent arg)
491491
try
492492
{
493493
await ctx.ReplyAsync("Your file is being downloaded...");
494-
await Module.Utility.EHentai.EHentaiDownloadAsync(ctx, _provider, ids, type switch
494+
await EHentai.EHentaiDownloadAsync(ctx, _provider, ids, type switch
495495
{
496496
'c' => EHentai.EHentaiType.Cosplay,
497497
'd' => EHentai.EHentaiType.Doujinshi,

0 commit comments

Comments
 (0)