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
@@ -27,7 +27,7 @@ First, you need to ask Discord to send you events. This is done via "Intents". R
27
27
28
28
Once you understand what intents are, you can enable the events you need, or just use the default ones with `discord.Intents.all()`.
29
29
30
-
Now that that's done, let's add an event handler for when a user joins the server. We will use the `on_member_join` event. We will send a private message to the user welcoming them to the server.
30
+
Now that that's done, let's add an event handler for when a user joins the server. We will use the [`on_member_join` event](https://docs.pycord.dev/en/master/api.html#discord.on_member_join). We will send a private message to the user welcoming them to the server.
31
31
32
32
```python
33
33
@bot.event
@@ -218,16 +218,21 @@ method, you can set a small footer that holds a message. This has `text` and `ic
218
218
- Author - With the [`set_author`](https://docs.pycord.dev/en/master/api.html#discord.Embed.set_author)
219
219
method, you can set an author for the embed. This is a small text field at the top of the embed. This
220
220
includes `name`, `url` and `icon_url` kwargs.
221
-
- Thumbnail - With the [`set_thumbnial`](https://docs.pycord.dev/en/master/api.html#discord.Embed.set_thumbnail)
221
+
- Thumbnail - With the [`set_thumbnail`](https://docs.pycord.dev/en/master/api.html#discord.Embed.set_thumbnail)
222
222
method, you can set a small image to reside at the top-right of the embed. This has a single `url` kwarg.
223
223
- Image - With the [`set_image`](https://docs.pycord.dev/en/master/api.html#discord.Embed.set_image)
224
224
method, you can set an image to sit at the bottom of an embed. This has a single `url` kwarg.
225
225
226
-
There are a lot more methods and attributes you can use to configure embeds. Here, we just covered the basics. Also remember that all of these values are not necessary in an embed. An embed may only contain a few of these, for example, only a description, or a title and a description, and so on.
226
+
There are a lot more methods and attributes you can use to configure embeds. Here, we just covered the basics. Also, remember that all of these values are not necessary in an embed. An embed may only contain a few of these. For example, only a description, a title and a description, and so on.
227
227
228
228
### Markdown
229
229
Markdown is a type of markup language that's limited in terms of formatting yet simple. Discord allows
230
-
for a watered-down version of markdown to be in their messages. This includes:
230
+
for a watered-down version of markdown to be in their messages.
231
+
232
+
#### Text Markdown
233
+
234
+
Text formatting can be used in messages and in most embed parts,
235
+
as explained in the dedicated section below.
231
236
232
237
<table>
233
238
<tr>
@@ -250,34 +255,122 @@ for a watered-down version of markdown to be in their messages. This includes:
250
255
</tr>
251
256
</table>
252
257
253
-
Sadly, Discord does not support other types, such as hyperlinks. The only supported places for hyperlinks are
254
-
in embeds and messages sent through webhooks.
258
+
#### Code Markdown
255
259
256
-
Adding markdown to your embeds or messages will give your bot the sparkle it needs.
260
+
To create a single-line code block without syntax highlight, wrap the text between single backticks.
261
+
This code block will only add a dark background to the text.
262
+
263
+
```
264
+
\`print("Hello world!")\`
265
+
```
257
266
258
-
Here is an example for a hyperlink in embeds.
267
+
To create a multi-line code block without syntax highlight, wrap the text between triple backticks
268
+
on first and last line. This type of code block will encase the code inside a box.
259
269
260
270
```
261
-
[Click here!](https://pycord.dev/)
271
+
\`\`\`
272
+
message = "Hello world!"
273
+
print(message)
274
+
\`\`\`
262
275
```
263
-
Inside the embed, the example above will look like this: [`Click here!`](https://pycord.dev/)
264
276
265
-
:::caution
266
-
267
-
Some embed fields, such as the footer, do not support markdown *at all*, including bold and italics.
268
-
269
-
:::
277
+
To create a multi-line block with syntax highlight, add the name of the language you are using right after
278
+
the triple backticks on the first line. For example, for Python you can write either "python" or "py".
270
279
271
-
#### Code Markdown
280
+
```
281
+
\`\`\`python
282
+
message = "Hello world!"
283
+
print(message)
284
+
\`\`\`
285
+
```
272
286
273
-
For code markdown, you can choose between `Code Text` and `Code Blocks`.
287
+
If you want to use syntax highlight for a single line of code, you still have to format it
288
+
like a multi-line block but the code must be on a separate line than the triple backticks.
274
289
275
-
-\`Code Text\`
276
-
-\`\`\`
290
+
#### Quote Markdown
277
291
278
-
Code Blocks
279
-
\`\`\`
292
+
To create a single-line quote block, start the line with `>` followed by a space.
280
293
281
-
Code Blocks support different programming languages, such as Python.
294
+
```
295
+
> This is a single-line quote.
296
+
```
282
297
283
-
If you start your Code Block with <code>```python</code>, you can send readable Python code to Discord.
298
+
To create a multi-line quote block, write `>>>` followed by a space. All text
299
+
from that point onwards will be included in that quote block.
300
+
301
+
```
302
+
>>> This is a
303
+
multi-line quote.
304
+
```
305
+
306
+
#### Spoiler Markdown
307
+
308
+
To hide a spoiler, encase the text between double pipes. The users
309
+
will have to click on it before being able to see the text contained in it.
310
+
311
+
```
312
+
||spoiler||
313
+
```
314
+
315
+
#### Link Markdown
316
+
317
+
Link formatting only works in embeds and messages sent through webhooks,
318
+
by using the following syntax:
319
+
320
+
```
321
+
[Pycord](https://pycord.dev/)
322
+
```
323
+
324
+
Inside the supported elements that have just been mentioned,
325
+
the example above will look like this: [`Pycord`](https://pycord.dev/)
326
+
327
+
Outside of them, the link will still be clickable but the formatting will be ignored,
328
+
therefore the example above will look similarly to this: `[Pycord](https://pycord.dev/)`
329
+
330
+
#### Embed Markdown
331
+
332
+
Adding markdown to your embeds or messages will give your bot the sparkle it needs,
333
+
however, markdown is limited inside embeds. Use the following table as a reference
334
+
and keep in mind that embed title and filed names will always show in **bold**.
Copy file name to clipboardExpand all lines: docs/installation.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,34 +18,34 @@ You can find instructions for that [here](More/virtual-environments).
18
18
19
19
To install Pycord, you can use the following command in your terminal:
20
20
21
-
python3 -m pip install py-cord
21
+
pip install py-cord
22
22
23
23
:::tip
24
24
Remember that you need to install `py-cord`, not `pycord`.
25
-
Also, the `python3` command varies depending on your installation. It might be `python`or `python3.8` as an example.
25
+
Also, the `pip` command varies depending on your installation. For example, it might be `python3 -m pip` on macOS/Linux or `py3 -m pip` on some versions of Windows.
26
26
:::
27
27
28
28
If you need voice support for your bot, you should run:
29
29
30
-
python3 -m pip install "py-cord[voice]"
30
+
pip install "py-cord[voice]"
31
31
32
32
## Migration
33
33
34
34
### Updating Pycord
35
35
36
36
If you are upgrading from a previous version of Pycord, you can use the following command in your terminal to upgrade to the latest version:
37
37
38
-
python3 -m pip install -U py-cord
38
+
pip install -U py-cord
39
39
40
40
### Migrating from other libraries
41
41
42
42
If you are migrating from another library, say, `discord.py`, first of all, you need to uninstall it.
43
43
44
-
python3 -m pip uninstall discord.py
44
+
pip uninstall discord.py
45
45
46
46
Then, you can install Pycord, it's as simple as that!:
47
47
48
-
python3 -m pip install py-cord
48
+
pip install py-cord
49
49
50
50
:::caution
51
51
Uninstalling `discord.py`*after* installing `py-cord` can cause issues. Make sure to uninstall it first!
@@ -61,7 +61,7 @@ The development build comes with cutting edge features and new functionality, bu
61
61
62
62
To install the development build, you can use the following command in your terminal:
When you right-click a message, you may see an option called "Apps". Hover over it and you can see
18
18
commands a bot can run with that message. These are called message commands.
19
19
20
-
When you right-click a message in the user list, you can once again see an option called "Apps".
20
+
When you right-click a user in the user list, you can once again see an option called "Apps".
21
21
Hover over it and you can see commands a bot can run with that message. These are called user commands.
22
22
23
23
Together, these two are called Context Menus or Context Menu Commands. These commands work very much like normal commands, except they take a member or message.
24
24
25
+
:::note
26
+
27
+
A bot can have up to 5 global Context Menus of each type.
0 commit comments