aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar thegamecracks <[email protected]>2022-11-10 21:54:59 -0500
committerGravatar thegamecracks <[email protected]>2022-11-10 21:55:51 -0500
commit50958801a6215446edb1c1d16065a3686ab58c2a (patch)
tree9b62d7b84d065463734a9f42aabd6d2e15bf0609
parentUpdate intents.md (diff)
Add further clarification to intents.md
- References discord.Intents documentation for detail on available intents and which features they impact - Explicitly describes no requirements for standard intents - Adds a code comment explaining the intents being enabled
-rw-r--r--bot/resources/tags/intents.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/bot/resources/tags/intents.md b/bot/resources/tags/intents.md
index 7aab9e470..99f14f931 100644
--- a/bot/resources/tags/intents.md
+++ b/bot/resources/tags/intents.md
@@ -1,17 +1,19 @@
**Using intents in discord.py**
-Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled. Since discord.py v2.0.0, this has become **mandatory** for developers to define in their code.
+Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed [in its documentation](https://discordpy.readthedocs.io/en/stable/api.html#intents). Since discord.py v2.0.0, it has become **mandatory** for developers to explicitly define the values of these intents in their code.
-There are *standard* intents and *privileged* intents. The current privileged intents are `Presences`, `Server Members`, and `Message Content`. To use one of the privileged intents, you have to first enable them in the [Discord Developer Portal](https://discord.com/developers/applications). Go to the `Bot` page of your application, scroll down to the `Privileged Gateway Intents` section, and enable the privileged intents that you need.
+There are *standard* and *privileged* intents. To use privileged intents like `Presences`, `Server Members`, and `Message Content`, you have to first enable them in the [Discord Developer Portal](https://discord.com/developers/applications). In there, go to the `Bot` page of your application, scroll down to the `Privileged Gateway Intents` section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.
Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the `intents` keyword argument, like this:
```py
from discord import Intents
from discord.ext import commands
+# Enable all standard intents and message content
+# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)
```
-For more info about using intents, see the [discord.py docs on intents](https://discordpy.readthedocs.io/en/latest/intents.html), and for general information about them, see the [Discord developer documentation on intents](https://discord.com/developers/docs/topics/gateway#gateway-intents).
+For more info about using intents, see [discord.py's related guide](https://discordpy.readthedocs.io/en/latest/intents.html), and for general information about them, see the [Discord developer documentation on intents](https://discord.com/developers/docs/topics/gateway#gateway-intents).