From c7b1134cd222541a1d9e56fdc89014f9742eeeaa Mon Sep 17 00:00:00 2001 From: Diabolical5777 <84365102+Diabolical5777@users.noreply.github.com> Date: Sun, 10 Jul 2022 20:37:56 +0400 Subject: Update subclassing_bot.md --- .../apps/content/resources/guides/python-guides/subclassing_bot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site/apps/content/resources') diff --git a/pydis_site/apps/content/resources/guides/python-guides/subclassing_bot.md b/pydis_site/apps/content/resources/guides/python-guides/subclassing_bot.md index 93d65b35..e8b5354a 100644 --- a/pydis_site/apps/content/resources/guides/python-guides/subclassing_bot.md +++ b/pydis_site/apps/content/resources/guides/python-guides/subclassing_bot.md @@ -10,7 +10,7 @@ First, a [basic article](https://www.codesdope.com/course/python-subclass-of-a- Subclassing Bot can be very beneficial as it provides you with more control and customisability of how your bot functions, also allowing you to add extra features, such as custom bot attributes or methods. For example, the default [Context](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Context) can be overriden to add more functionality. There are two ways to subclass `commands.Bot`, as shown below: -```py +```python class CustomBot(commands.Bot): def __init__(self): super().__init__( @@ -35,7 +35,7 @@ token = YOUR_TOKEN_HERE bot.run(token) ``` Or -```py +```python class CustomBot(commands.Bot): def __init__(self, *args, **kwargs): # the key-word arguments are not specified here, unlike the example above -- cgit v1.2.3