mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
Revert custom Bot.process_commands behaviour (#2768)
This still preserves the new event, which was a welcome change. However, context still needs to be invoked when a command isn't found, so `on_command_error` can still catch `commands.CommandNotFound`. Fixes broken fuzzy help. Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
parent
d133598d80
commit
cc927248f0
@ -215,18 +215,19 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin): # pylint: d
|
|||||||
|
|
||||||
async def process_commands(self, message: discord.Message):
|
async def process_commands(self, message: discord.Message):
|
||||||
"""
|
"""
|
||||||
modification from the base to do the same thing in the command case
|
Same as base method, but dispatches an additional event for cogs
|
||||||
|
which want to handle normal messages differently to command
|
||||||
but dispatch an additional event for cogs which want to handle normal messages
|
messages, without the overhead of additional get_context calls
|
||||||
differently to command messages,
|
per cog.
|
||||||
without the overhead of additional get_context calls per cog
|
|
||||||
"""
|
"""
|
||||||
if not message.author.bot:
|
if not message.author.bot:
|
||||||
ctx = await self.get_context(message)
|
ctx = await self.get_context(message)
|
||||||
if ctx.valid:
|
await self.invoke(ctx)
|
||||||
return await self.invoke(ctx)
|
else:
|
||||||
|
ctx = None
|
||||||
|
|
||||||
self.dispatch("message_without_command", message)
|
if ctx is None or ctx.valid is False:
|
||||||
|
self.dispatch("message_without_command", message)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def list_packages():
|
def list_packages():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user