From a9cf7cfcd7e402a332dfb1526263855dce55402c Mon Sep 17 00:00:00 2001 From: thegamecracks <61257169+thegamecracks@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:11:15 -0500 Subject: Update intents.md - More generally describes features enabled by intents - Adds a disclaimer for discord.py v2.0.0 requiring intents - Adds distinction between standard and privileged intents - Replaces `members` intent in code snippet with `message_content` in accordance with the usage of `commands.Bot` --- bot/resources/tags/intents.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bot/resources/tags/intents.md b/bot/resources/tags/intents.md index aa49d59ae..7aab9e470 100644 --- a/bot/resources/tags/intents.md +++ b/bot/resources/tags/intents.md @@ -1,19 +1,17 @@ **Using intents in discord.py** -Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default discord.py has all intents enabled except for `Members`, `Message Content`, and `Presences`. These are needed for features such as `on_member` events, to get access to message content, and to get members' statuses. +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. -To enable one of these intents, you need to first go to the [Discord developer portal](https://discord.com/developers/applications), then to the bot page of your bot's application. Scroll down to the `Privileged Gateway Intents` section, then enable the intents that you need. - -Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the `intents` keyword argument, like this: +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. +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 intents = Intents.default() -intents.members = True +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). -- cgit v1.2.3