[commands] Ignore bots from Bot.process_commands by default.
This commit is contained in:
parent
00ee7549c9
commit
aa7c5c3ec1
@ -916,11 +916,17 @@ class BotBase(GroupMixin):
|
|||||||
This is built using other low level tools, and is equivalent to a
|
This is built using other low level tools, and is equivalent to a
|
||||||
call to :meth:`~.Bot.get_context` followed by a call to :meth:`~.Bot.invoke`.
|
call to :meth:`~.Bot.get_context` followed by a call to :meth:`~.Bot.invoke`.
|
||||||
|
|
||||||
|
This also checks if the message's author is a bot and doesn't
|
||||||
|
call :meth:`~.Bot.get_context` or :meth:`~.Bot.invoke` if so.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
message : discord.Message
|
message: :class:`discord.Message`
|
||||||
The message to process commands for.
|
The message to process commands for.
|
||||||
"""
|
"""
|
||||||
|
if message.author.bot:
|
||||||
|
return
|
||||||
|
|
||||||
ctx = await self.get_context(message)
|
ctx = await self.get_context(message)
|
||||||
await self.invoke(ctx)
|
await self.invoke(ctx)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user