diff options
| author | Rapptz <[email protected]> | 2018-08-22 20:26:14 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-08-22 21:06:09 -0400 |
| commit | aa7c5c3ec1b2df6c95c39b149639ebca9aa68859 (patch) | |
| tree | 3f3ee46f80cc5aa74711140a58a401b150492566 | |
| parent | Update new member example to not be broken. (diff) | |
| download | discord.py-aa7c5c3ec1b2df6c95c39b149639ebca9aa68859.tar.xz discord.py-aa7c5c3ec1b2df6c95c39b149639ebca9aa68859.zip | |
[commands] Ignore bots from Bot.process_commands by default.
| -rw-r--r-- | discord/ext/commands/bot.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 74288a5a..b6556592 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -916,11 +916,17 @@ class BotBase(GroupMixin): 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`. + 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 ----------- - message : discord.Message + message: :class:`discord.Message` The message to process commands for. """ + if message.author.bot: + return + ctx = await self.get_context(message) await self.invoke(ctx) |