Skip to content
  • Sponsor Rapptz/discord.py

  • Notifications You must be signed in to change notification settings
  • Fork 3.8k
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Rapptz/discord.py
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: RasPython3/discord.py
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Mar 16, 2024

  1. Add modifications

    RasPython3 committed Mar 16, 2024
    Copy the full SHA
    418b9cb View commit details
Showing with 7 additions and 5 deletions.
  1. +1 −1 discord/ext/commands/bot.py
  2. +6 −4 discord/ext/commands/core.py
2 changes: 1 addition & 1 deletion discord/ext/commands/bot.py
Original file line number Diff line number Diff line change
@@ -1399,7 +1399,7 @@ async def process_commands(self, message: Message, /) -> None:

ctx = await self.get_context(message)
# the type of the invocation context's bot attribute will be correct
await self.invoke(ctx) # type: ignore
return await self.invoke(ctx) # type: ignore ###

async def on_message(self, message: Message, /) -> None:
await self.process_commands(message)
10 changes: 6 additions & 4 deletions discord/ext/commands/core.py
Original file line number Diff line number Diff line change
@@ -1026,7 +1026,7 @@ async def invoke(self, ctx: Context[BotT], /) -> None:
ctx.invoked_subcommand = None
ctx.subcommand_passed = None
injected = hooked_wrapped_callback(self, ctx, self.callback) # type: ignore
await injected(*ctx.args, **ctx.kwargs) # type: ignore
return await injected(*ctx.args, **ctx.kwargs) # type: ignore ###

async def reinvoke(self, ctx: Context[BotT], /, *, call_hooks: bool = False) -> None:
ctx.command = self
@@ -1641,18 +1641,20 @@ async def invoke(self, ctx: Context[BotT], /) -> None:

if early_invoke:
injected = hooked_wrapped_callback(self, ctx, self.callback) # type: ignore
await injected(*ctx.args, **ctx.kwargs) # type: ignore
result = await injected(*ctx.args, **ctx.kwargs) # type: ignore ###
if result:
return result

ctx.invoked_parents.append(ctx.invoked_with) # type: ignore

if trigger and ctx.invoked_subcommand:
ctx.invoked_with = trigger
await ctx.invoked_subcommand.invoke(ctx)
return await ctx.invoked_subcommand.invoke(ctx) ###
elif not early_invoke:
# undo the trigger parsing
view.index = previous
view.previous = previous
await super().invoke(ctx)
return await super().invoke(ctx) ###

async def reinvoke(self, ctx: Context[BotT], /, *, call_hooks: bool = False) -> None:
ctx.invoked_subcommand = None