Browse Source

fix build errors

pull/2169/head
Cenngo 3 years ago
parent
commit
114221f32a
2 changed files with 15 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Interactions/Info/Commands/SlashCommandInfo.cs
  2. +14
    -0
      src/Discord.Net.Interactions/InteractionService.cs

+ 1
- 1
src/Discord.Net.Interactions/Info/Commands/SlashCommandInfo.cs View File

@@ -88,7 +88,7 @@ namespace Discord.Interactions
}
return await RunAsync(context, args, services).ConfigureAwait(false);
}
else
catch(Exception ex)
{
return await InvokeEventAndReturn(context, ExecuteResult.FromError(ex)).ConfigureAwait(false);
}


+ 14
- 0
src/Discord.Net.Interactions/InteractionService.cs View File

@@ -785,6 +785,20 @@ namespace Discord.Interactions
return await commandResult.Command.ExecuteAsync(context, services).ConfigureAwait(false);
}

private async Task<IResult> ExecuteModalCommandAsync(IInteractionContext context, string input, IServiceProvider services)
{
var result = _modalCommandMap.GetCommand(input);

if (!result.IsSuccess)
{
await _cmdLogger.DebugAsync($"Unknown custom interaction id, skipping execution ({input.ToUpper()})");

await _componentCommandExecutedEvent.InvokeAsync(null, context, result).ConfigureAwait(false);
return result;
}
return await result.Command.ExecuteAsync(context, services, result.RegexCaptureGroups).ConfigureAwait(false);
}

internal TypeConverter GetTypeConverter(Type type, IServiceProvider services = null)
=> _typeConverterMap.Get(type, services);



Loading…
Cancel
Save