aboutsummaryrefslogtreecommitdiff
path: root/docs/migrating.rst
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-05-22 07:21:23 -0400
committerRapptz <[email protected]>2017-05-22 07:21:23 -0400
commitf5888765871b9f6ba1b7affca9271b1a3d0c8a8e (patch)
tree91d014b91dc7e9c8b3e3233a20f4a621975d3095 /docs/migrating.rst
parentRaise when an invalid permission is passed to PermissionOverwrite. (diff)
downloaddiscord.py-f5888765871b9f6ba1b7affca9271b1a3d0c8a8e.tar.xz
discord.py-f5888765871b9f6ba1b7affca9271b1a3d0c8a8e.zip
Use Python3Lexer instead of PythonLexer for pygments.
Diffstat (limited to 'docs/migrating.rst')
-rw-r--r--docs/migrating.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/migrating.rst b/docs/migrating.rst
index 13b869aa..2a2ad72a 100644
--- a/docs/migrating.rst
+++ b/docs/migrating.rst
@@ -626,7 +626,7 @@ For example, to wait for a reaction: ::
Since this function now can return multiple arguments, the ``timeout`` parameter will now raise a ``asyncio.TimeoutError``
when reached instead of setting the return to ``None``. For example:
-.. code-block:: python
+.. code-block:: python3
def pred(m):
return m.author == message.author and m.channel == message.channel
@@ -726,7 +726,7 @@ In v1.0, the :class:`.Context` has received a lot of changes with how it's retri
The biggest change is that ``pass_context=True`` is now the default behaviour. Ergo:
-.. code-block:: python
+.. code-block:: python3
# before
@bot.command()
@@ -768,7 +768,7 @@ provided one.
For example, if you want to add some functionality to the context:
-.. code-block:: python
+.. code-block:: python3
class MyContext(commands.Context):
@property
@@ -778,7 +778,7 @@ For example, if you want to add some functionality to the context:
Then you can use :meth:`~ext.commands.Bot.get_context` inside :func:`on_message` with combination with
:meth:`~ext.commands.Bot.invoke` to use your custom context:
-.. code-block:: python
+.. code-block:: python3
class MyBot(commands.Bot):
async def on_message(self, message):
@@ -787,7 +787,7 @@ Then you can use :meth:`~ext.commands.Bot.get_context` inside :func:`on_message`
Now inside your commands you will have access to your custom context:
-.. code-block:: python
+.. code-block:: python3
@bot.command()
async def secret(ctx):