Browse Source

fix implementation bugs

pull/2306/head
Cenngo 3 years ago
parent
commit
36b8bb0097
3 changed files with 4 additions and 5 deletions
  1. +2
    -3
      src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs
  2. +1
    -1
      src/Discord.Net.Interactions/Info/Commands/ContextCommands/MessageCommandInfo.cs
  3. +1
    -1
      src/Discord.Net.Interactions/Info/Commands/ContextCommands/UserCommandInfo.cs

+ 2
- 3
src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs View File

@@ -110,11 +110,10 @@ namespace Discord.Interactions
{
await CommandService._cmdLogger.DebugAsync($"Executing {GetLogString(context)}").ConfigureAwait(false);

using var scope = services?.CreateScope();
if (CommandService._autoServiceScopes)
{
using var scope = services?.CreateScope();
services = scope?.ServiceProvider ?? EmptyServiceProvider.Instance;
}

try
{


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

@@ -17,7 +17,7 @@ namespace Discord.Interactions
if (context.Interaction is not IMessageCommandInteraction)
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)


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

@@ -17,7 +17,7 @@ namespace Discord.Interactions
if (context.Interaction is not IUserCommandInteraction userCommand)
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)


Loading…
Cancel
Save