Browse Source

Add message content to doc examples

This also changes the wording of Context's attributes 
for consistency.
pull/7691/head
Cryptex 3 years ago
committed by GitHub
parent
commit
6cf7c4a7d7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      docs/ext/commands/commands.rst
  2. 7
      docs/quickstart.rst

6
docs/ext/commands/commands.rst

@ -178,9 +178,9 @@ As seen earlier, every command must take at least a single parameter, called the
This parameter gives you access to something called the "invocation context". Essentially all the information you need to This parameter gives you access to something called the "invocation context". Essentially all the information you need to
know how the command was executed. It contains a lot of useful information: know how the command was executed. It contains a lot of useful information:
- :attr:`.Context.guild` to fetch the :class:`Guild` of the command, if any. - :attr:`.Context.guild` returns the :class:`Guild` of the command, if any.
- :attr:`.Context.message` to fetch the :class:`Message` of the command. - :attr:`.Context.message` returns the :class:`Message` of the command.
- :attr:`.Context.author` to fetch the :class:`Member` or :class:`User` that called the command. - :attr:`.Context.author` returns the :class:`Member` or :class:`User` that called the command.
- :meth:`.Context.send` to send a message to the channel the command was used in. - :meth:`.Context.send` to send a message to the channel the command was used in.
The context implements the :class:`abc.Messageable` interface, so anything you can do on a :class:`abc.Messageable` you The context implements the :class:`abc.Messageable` interface, so anything you can do on a :class:`abc.Messageable` you

7
docs/quickstart.rst

@ -19,9 +19,14 @@ It looks something like this:
.. code-block:: python3 .. code-block:: python3
# This example requires the 'message_content' intent.
import discord import discord
client = discord.Client() intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event @client.event
async def on_ready(): async def on_ready():

Loading…
Cancel
Save