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
Copy file name to clipboardExpand all lines: docs/getting-started/more-features.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ So, that's how you add event handlers!
45
45
46
46
### Waiting for User Response
47
47
48
-
Let's say you want to create a Guess-the-Number game (where the user has to guess a number between 1-10). You need to send a message to a user and wait for them to respond. You can do this with the [`wait_for`](https://docs.pycord.dev/en/stable/api.html#discord.Bot.wait_for) method.
48
+
Let's say you want to create a Guess-the-Number game (where the user has to guess a number between 1-10). You need to send a message to a user and wait for them to respond. You can do this with the [`wait_for`](https://docs.pycord.dev/en/stable/api/clients.html#discord.Bot.wait_for) method.
49
49
50
50
```python
51
51
@bot.command()
@@ -114,7 +114,7 @@ enabling your bot to lay out messages with a lot of text into neat fields.
114
114
115
115
<br/>
116
116
117
-
Creating embeds is simple! Just create an instance of [`discord.Embed`](https://docs.pycord.dev/en/stable/api.html#discord.Embed) and edit it to your liking. Once you're done, send it!
117
+
Creating embeds is simple! Just create an instance of [`discord.Embed`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed) and edit it to your liking. Once you're done, send it!
118
118
119
119
```python
120
120
import discord
@@ -187,10 +187,10 @@ embed = discord.Embed(
187
187
)
188
188
```
189
189
190
-
This command creates an embed. We use the [`Embed`](https://docs.pycord.dev/en/stable/api.html#discord.Embed)
190
+
This command creates an embed. We use the [`Embed`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed)
191
191
class to create an embed object with the title "My Amazing Embed", the description "Embeds are super easy, barely an inconvenience.", and the color `blurple`, Discord's main theme color.
192
192
193
-
[discord.Colour](https://docs.pycord.dev/en/stable/api.html#colour) is a class full of [classmethods](https://docs.python.org/3/library/functions.html#classmethod)
193
+
[discord.Colour](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Colour) is a class full of [classmethods](https://docs.python.org/3/library/functions.html#classmethod)
194
194
that return color values. While the official, documented name of this is `discord.Colour`, `discord.Color`
195
195
works as well.
196
196
@@ -201,8 +201,8 @@ embed.add_field(title="Inline Field 2", value="Inline Field 2", inline=True)
201
201
embed.add_field(title="Inline Field 3", value="Inline Field 3", inline=True)
202
202
```
203
203
204
-
This small section shows off embed fields. You can add fields to embeds with the [`add_field` method](https://docs.pycord.dev/en/stable/api.html#discord.Embed.add_field)
205
-
of the [`discord.Embed`](https://docs.pycord.dev/en/stable/api.html#embed) class. These consist of three
204
+
This small section shows off embed fields. You can add fields to embeds with the [`add_field` method](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed.add_field)
205
+
of the [`discord.Embed`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed) class. These consist of three
206
206
keyword arguments: `title`, `value`, and `inline`. `title` and `value` are both required arguments, which inline defaults to `False` if it's not defined. The `inline` argument specifies whether space will be divided among the inline fields. There could be a mix of fields where inline has different values too.
In this section, we're adding unique items to the embed. These items are:
216
-
- Footer - With the [`set_footer()`](https://docs.pycord.dev/en/stable/api.html#discord.Embed.set_footer)
216
+
- Footer - With the [`set_footer()`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed.set_footer)
217
217
method, you can set a small footer that holds a message. This has `text` and `icon_url` kwargs.
218
-
- Author - With the [`set_author`](https://docs.pycord.dev/en/stable/api.html#discord.Embed.set_author)
218
+
- Author - With the [`set_author`](https://docs.pycord.dev/en/stable/api/data_classes.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_thumbnail`](https://docs.pycord.dev/en/stable/api.html#discord.Embed.set_thumbnail)
221
+
- Thumbnail - With the [`set_thumbnail`](https://docs.pycord.dev/en/stable/api/data_classes.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
-
- Image - With the [`set_image`](https://docs.pycord.dev/en/stable/api.html#discord.Embed.set_image)
223
+
- Image - With the [`set_image`](https://docs.pycord.dev/en/stable/api/data_classes.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
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.
Copy file name to clipboardExpand all lines: docs/interactions/application-commands/slash-commands.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,11 +62,11 @@ Let's go through the code.
62
62
63
63
First, we import Pycord's `discord` package.
64
64
65
-
Next, we create a [`discord.Bot`](https://docs.pycord.dev/en/stable/api.html#discord.Bot) object and assign it to a variable `bot`.
65
+
Next, we create a [`discord.Bot`](https://docs.pycord.dev/en/stable/api/clients.html#discord.Bot) object and assign it to a variable `bot`.
66
66
67
-
We then go ahead and use the [`@bot.command`](https://docs.pycord.dev/en/stable/api.html#discord.Bot.command) decorator, which registers a new Slash Command. We pass a `description` parameter to give a description to the Slash Command. We can also pass a `name` parameter to change the Slash Command's name. By default, the name of the Slash Command will be the name of the function, in this case, `/ping`.
67
+
We then go ahead and use the [`@bot.command`](https://docs.pycord.dev/en/stable/api/clients.html#discord.Bot.command) decorator, which registers a new Slash Command. We pass a `description` parameter to give a description to the Slash Command. We can also pass a `name` parameter to change the Slash Command's name. By default, the name of the Slash Command will be the name of the function, in this case, `/ping`.
68
68
69
-
We create an async function called `ping` with parameters `ctx`, which, when called, sends the bot's ping/latency using [`ctx.respond`](https://docs.pycord.dev/en/stable/api.html#discord.ApplicationContext.respond).
69
+
We create an async function called `ping` with parameters `ctx`, which, when called, sends the bot's ping/latency using [`ctx.respond`](https://docs.pycord.dev/en/stable/api/application_commands.html#discord.ApplicationContext.respond).
70
70
71
71
## Subcommand Groups
72
72
@@ -179,7 +179,7 @@ bot.run("TOKEN")
179
179
</TabItem>
180
180
<TabItemvalue="1"label="Using the SlashCommandOptionType enum">
181
181
182
-
You could also explicitly declare the type using the [`SlashCommandOptionType`](https://docs.pycord.dev/en/stable/api.html#discord.SlashCommandOptionType) enum.
182
+
You could also explicitly declare the type using the [`SlashCommandOptionType`](https://docs.pycord.dev/en/stable/api/enums.html#discord.SlashCommandOptionType) enum.
Slash Commands were the first Interaction added to Discord. They're easy to use and create, and
47
47
is the only prefix commands alternative that does not need Message Content intent.
@@ -77,7 +77,7 @@ apart from the note telling you who invoked it. A Slash Command's fields can acc
77
77
78
78
Just about as good as it gets.
79
79
80
-
### [Message](https://docs.pycord.dev/en/stable/api.html#messagecommand) and [User](https://docs.pycord.dev/en/stable/api.html#usercommand) Commands
80
+
### [Message](https://docs.pycord.dev/en/stable/api/application_commands.html#discord.MessageCommand) and [User](https://docs.pycord.dev/en/stable/api/application_commands.html#discord.UserCommand) Commands
81
81
82
82
Message Commands and User Commands were both introduced at around the same time, and are very similar to each other, so we'll be
83
83
introducing them together. These commands can be found in the `Apps` tab when alt-clicking. The only difference between the two is that
@@ -181,10 +181,10 @@ Message Components are fairly new features in Discord, allowing developers to gi
181
181
and understandable user interface. Message Components are easy to use and make your bot look modern,
This decorator adds a button to a component. This function takes two arguments: the button that was
82
82
clicked and the interaction. These arguments are passed to the function when the button is clicked
83
-
by the module. We use the [`interaction.response.send_message`](https://docs.pycord.dev/en/stable/api.html#discord.InteractionResponse.send_message)
83
+
by the module. We use the [`interaction.response.send_message`](https://docs.pycord.dev/en/stable/api/models.html#discord.InteractionResponse.send_message)
84
84
function to send a message to the channel where the interaction was sent.
85
85
86
86
Finally, we create a global slash command called `button` that sends the message, along with the view
@@ -101,11 +101,11 @@ about making your button do amazing things, while Pycord handles the rest!
0 commit comments