You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The official Guide for Pycord, explaining Pycord's features and how to use them.
5
4
@@ -18,7 +17,7 @@ The Guide is built using [Docusaurus 2](https://docusaurus.io/), a modern static
18
17
19
18
[`/src`](./src) contains styling (`.scss`) and the index (`.tsx`/`jsx`).
20
19
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.
Copy file name to clipboardExpand all lines: docs/extensions/tasks/tasks.mdx
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ doing very useful stuff.
35
35
doing very useful stuff.
36
36
```
37
37
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):
39
39
40
40
```py
41
41
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
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!
72
72
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)
74
74
75
75
A look at `discord.ext.tasks.loop`'s definition in the documentation reveals that:
76
76
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).
82
82
to make it run forever which is also the default.
83
83
4. The loop function ***must*** be a coroutine.
84
84
85
-
These are all really useful and they aren't the only parameters so if you wanna know more about them check out the
0 commit comments