@@ -110,11 +110,10 @@ namespace Discord.Interactions | |||||
{ | { | ||||
await CommandService._cmdLogger.DebugAsync($"Executing {GetLogString(context)}").ConfigureAwait(false); | await CommandService._cmdLogger.DebugAsync($"Executing {GetLogString(context)}").ConfigureAwait(false); | ||||
using var scope = services?.CreateScope(); | |||||
if (CommandService._autoServiceScopes) | if (CommandService._autoServiceScopes) | ||||
{ | |||||
using var scope = services?.CreateScope(); | |||||
services = scope?.ServiceProvider ?? EmptyServiceProvider.Instance; | services = scope?.ServiceProvider ?? EmptyServiceProvider.Instance; | ||||
} | |||||
try | try | ||||
{ | { | ||||
@@ -17,7 +17,7 @@ namespace Discord.Interactions | |||||
if (context.Interaction is not IMessageCommandInteraction) | if (context.Interaction is not IMessageCommandInteraction) | ||||
return ExecuteResult.FromError(InteractionCommandError.ParseFailed, $"Provided {nameof(IInteractionContext)} doesn't belong to a Message Command Interation"); | return ExecuteResult.FromError(InteractionCommandError.ParseFailed, $"Provided {nameof(IInteractionContext)} doesn't belong to a Message Command Interation"); | ||||
return await ExecuteAsync(context, services).ConfigureAwait(false); | |||||
return await base.ExecuteAsync(context, services).ConfigureAwait(false); | |||||
} | } | ||||
protected override Task<IResult> ParseArgumentsAsync(IInteractionContext context, IServiceProvider services) | protected override Task<IResult> ParseArgumentsAsync(IInteractionContext context, IServiceProvider services) | ||||
@@ -17,7 +17,7 @@ namespace Discord.Interactions | |||||
if (context.Interaction is not IUserCommandInteraction userCommand) | if (context.Interaction is not IUserCommandInteraction userCommand) | ||||
return ExecuteResult.FromError(InteractionCommandError.ParseFailed, $"Provided {nameof(IInteractionContext)} doesn't belong to a Message Command Interation"); | return ExecuteResult.FromError(InteractionCommandError.ParseFailed, $"Provided {nameof(IInteractionContext)} doesn't belong to a Message Command Interation"); | ||||
return await ExecuteAsync(context, services).ConfigureAwait(false); | |||||
return await base.ExecuteAsync(context, services).ConfigureAwait(false); | |||||
} | } | ||||
protected override Task<IResult> ParseArgumentsAsync(IInteractionContext context, IServiceProvider services) | protected override Task<IResult> ParseArgumentsAsync(IInteractionContext context, IServiceProvider services) | ||||