Skip to content

Commit b580860

Browse files
authored
Merge pull request #249 from Pycord-Development/main
stuff
2 parents 09c5b82 + 1232979 commit b580860

26 files changed

+283
-284
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Pycord Guide
2-
[![Netlify Status](https://api.netlify.com/api/v1/badges/c6976714-2c3d-4ff5-a30f-cf784045062a/deploy-status)](https://app.netlify.com/sites/pycord/deploys)
32

43
The official Guide for Pycord, explaining Pycord's features and how to use them.
54

@@ -18,7 +17,7 @@ The Guide is built using [Docusaurus 2](https://docusaurus.io/), a modern static
1817

1918
[`/src`](./src) contains styling (`.scss`) and the index (`.tsx`/`jsx`).
2019

21-
[`/docs`](./docs) contains the pages for the guide. The Guide Pages are writtern in the `mdx` file format, a combination of Markdown syntax and JSX/React.
20+
[`/docs`](./docs) contains the pages for the guide. The Guide Pages are written in the `mdx` file format, a combination of Markdown syntax and JSX/React.
2221

2322
## Local Development
2423

docs/extensions/commands/help-command.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ of making one with Pycord. Making a help command with subclassing and OOP will s
5454

5555
There are two types of built-in help commands:
5656

57-
- [`DefaultHelpCommand`](https://docs.pycord.dev/en/master/api.html#discord.ext.commands.DefaultHelpCommand)
58-
- [`MinimalHelpCommand`](https://docs.pycord.dev/en/master/api.html#discord.ext.commands.MinimalHelpCommand)
57+
- [`DefaultHelpCommand`](https://docs.pycord.dev/en/stable/api.html#discord.ext.commands.DefaultHelpCommand)
58+
- [`MinimalHelpCommand`](https://docs.pycord.dev/en/stable/api.html#discord.ext.commands.MinimalHelpCommand)
5959

6060
`DefaultHelpCommand` is the command enabled by default. It isn't the best looking, but `MinimalHelpCommand` can help make it look a bit better.
6161

@@ -359,7 +359,7 @@ class MyHelp(commands.HelpCommand):
359359
await self.get_destination().send(embed=embed)
360360
```
361361

362-
Add all of these methods together and you have a fully functioning help command!
362+
Add all of these methods together, and you have a fully functioning help command!
363363

364364
<details>
365365
<summary>Click to see the final code for this section</summary>

docs/extensions/pages/paginator-basics.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Paginator Basics
44

55
# Paginator Basics
66

7-
## [Page](https://docs.pycord.dev/en/master/ext/pages/index.html#page)
7+
## [Page](https://docs.pycord.dev/en/stable/ext/pages/index.html#page)
88
This class contains two attributes: `content` and `embeds`, which correspond to the attributes of the same name on the
99
`discord.Message` class.
1010
To create a new Page, use the following syntax:
@@ -13,11 +13,11 @@ import discord
1313
page = Page(content="My Page Content", embeds=[discord.Embed(title="My First Embed Title")])
1414
```
1515

16-
## [PageGroup](https://docs.pycord.dev/en/master/ext/pages/index.html#pagegroup)
16+
## [PageGroup](https://docs.pycord.dev/en/stable/ext/pages/index.html#pagegroup)
1717
This class represents a group of pages. It uses most of the same parameters as `Paginator`, which allows each
1818
`PageGroup` to effectively have its own settings and behaviours.
1919

20-
## [Paginator](https://docs.pycord.dev/en/master/ext/pages/index.html#paginator)
20+
## [Paginator](https://docs.pycord.dev/en/stable/ext/pages/index.html#paginator)
2121
This is the main class for `ext.pages`, and is used to control most of the functionality of the extension.
2222

2323
In its most basic form, with no arguments provided (default values listed below), a paginator can be created like so:
@@ -54,8 +54,8 @@ The only required parameter for `Paginator` is the `pages` parameter, which is u
5454
You can also pass in a list of `PageGroup` objects, a list of strings, a list of embeds, or a list of lists of embeds.
5555

5656
Once the `Paginator` instance is created, you can call either
57-
[`Paginator.send()`](https://docs.pycord.dev/en/master/ext/pages/index.html#discord.ext.pages.Paginator.send)
58-
or [`Paginator.respond()`](https://docs.pycord.dev/en/master/ext/pages/index.html#discord.ext.pages.Paginator.respond)
57+
[`Paginator.send()`](https://docs.pycord.dev/en/stable/ext/pages/index.html#discord.ext.pages.Paginator.send)
58+
or [`Paginator.respond()`](https://docs.pycord.dev/en/stable/ext/pages/index.html#discord.ext.pages.Paginator.respond)
5959
to send a message or response with the paginator's contents.
6060

6161
#### Depending on what's being passed to the `pages` parameter, the behaviour of the paginator may differ:
@@ -89,11 +89,11 @@ child list. This type of page cannot have any message content.
8989
- When using the default buttons, shows a middle 5th button with the current/total page numbers.
9090

9191
**For other parameters that can be set on initialization, please check the
92-
[API Reference](https://docs.pycord.dev/en/master/ext/pages/index.html#paginator)**
92+
[API Reference](https://docs.pycord.dev/en/stable/ext/pages/index.html#paginator)**
9393

9494

9595

96-
## [PaginatorButton](https://docs.pycord.dev/en/master/ext/pages/index.html#paginatorbutton)
96+
## [PaginatorButton](https://docs.pycord.dev/en/stable/ext/pages/index.html#paginatorbutton)
9797
This class represents a button used to navigate between the pages of a paginator. It's also used to create the page
9898
indicator.
9999

@@ -143,7 +143,7 @@ paginator.remove_button("last")
143143
```
144144

145145

146-
## [PaginatorMenu](https://docs.pycord.dev/en/master/ext/pages/index.html#paginatormenu)
146+
## [PaginatorMenu](https://docs.pycord.dev/en/stable/ext/pages/index.html#paginatormenu)
147147
This class represents the `discord.Select` menu used to navigate between `PageGroup` instances. In most situations, you
148148
will not need to interact with this class directly.
149149

docs/extensions/tasks/tasks.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ doing very useful stuff.
3535
doing very useful stuff.
3636
```
3737

38-
For a more useful example here's a task in a cog context ripped straight from the [docs](https://docs.pycord.dev/en/master/ext/tasks/index.html#recepies):
38+
For a more useful example here's a task in a cog context ripped straight from the [docs](https://docs.pycord.dev/en/stable/ext/tasks/index.html#recepies):
3939

4040
```py
4141
from discord.ext import tasks, commands
@@ -64,13 +64,13 @@ As you'd expect this will increment a number and print it out every 5 seconds li
6464
# ...
6565
```
6666

67-
## [Tasks](https://docs.pycord.dev/en/master/ext/tasks/index.html)
67+
## [Tasks](https://docs.pycord.dev/en/stable/ext/tasks/index.html)
6868

6969
Now let's get into the nitty-gritty of tasks.
7070

7171
As you've seen tasks can work in both outer scope and class contexts and the handle is roughly the same, you define a task using the `tasks.loop` decorator and use the `start` method to start it, the difference is you add the `self` argument when in a class context so since most people have all their bot's code in Cogs all the following code blocks will be in a Cog context to make it easy to copy it then apply whatever modifications you might need!
7272

73-
### [Creating a task](https://docs.pycord.dev/en/master/ext/tasks/index.html#discord.ext.tasks.loop)
73+
### [Creating a task](https://docs.pycord.dev/en/stable/ext/tasks/index.html#discord.ext.tasks.loop)
7474

7575
A look at `discord.ext.tasks.loop`'s definition in the documentation reveals that:
7676
1. As you've seen before it expects the time between each execution, that however doesn't have to be in seconds as
@@ -82,8 +82,8 @@ at the specified time(s).
8282
to make it run forever which is also the default.
8383
4. The loop function ***must*** be a coroutine.
8484

85-
These are all really useful and they aren't the only parameters so if you wanna know more about them check out the
86-
[docs](https://docs.pycord.dev/en/master/ext/tasks/index.html#discord.ext.tasks.loop)!
85+
These are all really useful, and they aren't the only parameters so if you want to know more about them check out the
86+
[docs](https://docs.pycord.dev/en/stable/ext/tasks/index.html#discord.ext.tasks.loop)!
8787

8888
### Attributes
8989

@@ -103,7 +103,7 @@ Now let's create a cog that handles a leaderboard we have in our bot using Tasks
103103
also provide a refresher of how slash commands groups work in cogs.
104104

105105
For the sake of this example let's pretend that we have a leaderboard module that does all the leaderboard handling for
106-
us and that computing the leaderboard is very expensive computationally wise so we want to store one version of it that
106+
us and that computing the leaderboard is very expensive computationally wise, so we want to store one version of it that
107107
gets regularly updated instead of generating it every time someone calls the `/leaderboard view` command.
108108
```py
109109
from discord.ext import tasks, commands
@@ -183,30 +183,30 @@ Now to explain what's going on:
183183
First things first we create a cog and in its `__init__` function we start the `update_leaderboard` task and generate
184184
the first instance of our leaderboard's embed.
185185

186-
After that, we define the `update_leaderboard` task using the `loop` decorator and we make it run every ten minutes by
186+
After that, we define the `update_leaderboard` task using the `loop` decorator, and we make it run every ten minutes by
187187
passing 10 to the `minutes` parameter.
188188

189-
Then that we define the `before_update_leaderboard` task using the `before_loop` decorator and we make it wait until the
189+
Then that we define the `before_update_leaderboard` task using the `before_loop` decorator, and we make it wait until the
190190
bot is ready before starting the task.
191191

192-
Next up we define the `after_update_leaderboard` task using the `after_loop` decorator and we make it clean up the
192+
Next up we define the `after_update_leaderboard` task using the `after_loop` decorator, and we make it clean up the
193193
leaderboard when the loop finally stops running.
194194

195-
Then we define the `update_leaderboard_error` task using the `error` decorator and we make it print any errors that may
195+
Then we define the `update_leaderboard_error` task using the `error` decorator, and we make it print any errors that may
196196
occur while we update our leaderboard to the console.
197197

198198
Then we get into the fun stuff, we create a slash command group using the `SlashCommandGroup` class and name it
199199
`leaderboard`, we then create the `view` sub-command which sends the embed generated when the leaderboard is updated and
200-
`update_info` which shows a lot of data about the task using some of the attributes and functions available to us.
200+
`update_info` which shows a lot of data about the task using some attributes and functions available to us.
201201

202202
We also create a slash command group called `leaderboard_config` which is only available to the owner of the bot.
203203

204204
Then we create the `set_time_between_updates` sub-command which takes in the time in minutes and changes the time
205205
between updates of the leaderboard using the `change_interval` method, the `stop` sub-command which stops the task using
206206
the `stop` method and `restart` which restarts the task using the `restart` method.
207207

208-
Finally, we add the `LeaderboardCog` cog to the bot and we're done!
208+
Finally, we add the `LeaderboardCog` cog to the bot, and we're done!
209209

210210
I'd highly recommend you check the tasks extension
211-
[documentation](https://docs.pycord.dev/en/master/ext/tasks/index.html) for more info on how to use them and what other
211+
[documentation](https://docs.pycord.dev/en/stable/ext/tasks/index.html) for more info on how to use them and what other
212212
functions they have.

docs/getting-started/creating-your-first-bot.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Next, we load the env file with `load_dotenv()`.
173173
bot = discord.Bot()
174174
```
175175

176-
In this line, we create a new instance of [`discord.Bot`](https://docs.pycord.dev/en/master/api.html#discord.Bot).
176+
In this line, we create a new instance of [`discord.Bot`](https://docs.pycord.dev/en/stable/api.html#discord.Bot).
177177
In this object, we can pass various parameters for configuration purposes, such as `owner_ids`
178178
and [`intents`](https://docs.pycord.dev/en/stable/api.html?highlight=get_message#discord.Intents).
179179

@@ -185,8 +185,8 @@ async def on_ready():
185185
print(f"{bot.user} is ready and online!")
186186
```
187187

188-
We use the [`event`](https://docs.pycord.dev/en/master/api.html#discord.Bot.event) decorator to override
189-
the [`on_ready`](https://docs.pycord.dev/en/master/api.html#discord.on_ready) function to define an
188+
We use the [`event`](https://docs.pycord.dev/en/stable/api.html#discord.Bot.event) decorator to override
189+
the [`on_ready`](https://docs.pycord.dev/en/stable/api.html#discord.on_ready) function to define an
190190
event that is automatically called when the bot is ready to use.
191191

192192
```py
@@ -195,7 +195,7 @@ async def say_hello(ctx):
195195
await ctx.respond("Hey!")
196196
```
197197

198-
Here, we use the [`slash_command`](https://docs.pycord.dev/en/master/api.html#discord.Bot.slash_command)
198+
Here, we use the [`slash_command`](https://docs.pycord.dev/en/stable/api.html#discord.Bot.slash_command)
199199
decorator to define a slash command. We specify the `name` and `description` arguments. If not
200200
specified, the name of the slash command would be the function name and the command description would
201201
be empty.

0 commit comments

Comments
 (0)