Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/extensions/commands/help-command.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ of making one with Pycord. Making a help command with subclassing and OOP will s

There are two types of built-in help commands:

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

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

Expand Down
10 changes: 5 additions & 5 deletions docs/getting-started/creating-your-first-bot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ Next, we load the env file with `load_dotenv()`.
bot = discord.Bot()
```

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



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

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

```py
Expand All @@ -195,7 +195,7 @@ async def say_hello(ctx):
await ctx.respond("Hey!")
```

Here, we use the [`slash_command`](https://docs.pycord.dev/en/stable/api.html#discord.Bot.slash_command)
Here, we use the [`slash_command`](https://docs.pycord.dev/en/stable/api/clients.html#discord.Bot.slash_command)
decorator to define a slash command. We specify the `name` and `description` arguments. If not
specified, the name of the slash command would be the function name and the command description would
be empty.
Expand Down
20 changes: 10 additions & 10 deletions docs/getting-started/more-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ So, that's how you add event handlers!

### Waiting for User Response

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.
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.

```python
@bot.command()
Expand Down Expand Up @@ -114,7 +114,7 @@ enabling your bot to lay out messages with a lot of text into neat fields.

<br/>

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!
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!

```python
import discord
Expand Down Expand Up @@ -187,10 +187,10 @@ embed = discord.Embed(
)
```

This command creates an embed. We use the [`Embed`](https://docs.pycord.dev/en/stable/api.html#discord.Embed)
This command creates an embed. We use the [`Embed`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed)
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.

[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)
[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)
that return color values. While the official, documented name of this is `discord.Colour`, `discord.Color`
works as well.

Expand All @@ -201,8 +201,8 @@ embed.add_field(title="Inline Field 2", value="Inline Field 2", inline=True)
embed.add_field(title="Inline Field 3", value="Inline Field 3", inline=True)
```

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)
of the [`discord.Embed`](https://docs.pycord.dev/en/stable/api.html#embed) class. These consist of three
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)
of the [`discord.Embed`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed) class. These consist of three
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.

```py
Expand All @@ -213,14 +213,14 @@ embed.set_image(url="https://example.com/link-to-my-banner.png")
```

In this section, we're adding unique items to the embed. These items are:
- Footer - With the [`set_footer()`](https://docs.pycord.dev/en/stable/api.html#discord.Embed.set_footer)
- Footer - With the [`set_footer()`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed.set_footer)
method, you can set a small footer that holds a message. This has `text` and `icon_url` kwargs.
- Author - With the [`set_author`](https://docs.pycord.dev/en/stable/api.html#discord.Embed.set_author)
- Author - With the [`set_author`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed.set_author)
method, you can set an author for the embed. This is a small text field at the top of the embed. This
includes `name`, `url` and `icon_url` kwargs.
- Thumbnail - With the [`set_thumbnail`](https://docs.pycord.dev/en/stable/api.html#discord.Embed.set_thumbnail)
- Thumbnail - With the [`set_thumbnail`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed.set_thumbnail)
method, you can set a small image to reside at the top-right of the embed. This has a single `url` kwarg.
- Image - With the [`set_image`](https://docs.pycord.dev/en/stable/api.html#discord.Embed.set_image)
- Image - With the [`set_image`](https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Embed.set_image)
method, you can set an image to sit at the bottom of an embed. This has a single `url` kwarg.

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.
Expand Down
8 changes: 4 additions & 4 deletions docs/interactions/application-commands/slash-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ Let's go through the code.

First, we import Pycord's `discord` package.

Next, we create a [`discord.Bot`](https://docs.pycord.dev/en/stable/api.html#discord.Bot) object and assign it to a variable `bot`.
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`.

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`.
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`.

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).
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).

## Subcommand Groups

Expand Down Expand Up @@ -179,7 +179,7 @@ bot.run("TOKEN")
</TabItem>
<TabItem value="1" label="Using the SlashCommandOptionType enum">

You could also explicitly declare the type using the [`SlashCommandOptionType`](https://docs.pycord.dev/en/stable/api.html#discord.SlashCommandOptionType) enum.
You could also explicitly declare the type using the [`SlashCommandOptionType`](https://docs.pycord.dev/en/stable/api/enums.html#discord.SlashCommandOptionType) enum.

```python title="Slash Command Type"
import discord
Expand Down
14 changes: 7 additions & 7 deletions docs/interactions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Form-like modals can be used to ask for input from a user.
Application Commands are another set of new features that are intended to avoid compromising users' safety and privacy.
They're relatively easy to add to your bot, and give people a simpler and safer way to use commands.

### [Slash Commands](https://docs.pycord.dev/en/stable/api.html#slashcommand)
### [Slash Commands](https://docs.pycord.dev/en/stable/api/application_commands.html#discord.SlashCommand)

Slash Commands were the first Interaction added to Discord. They're easy to use and create, and
is the only prefix commands alternative that does not need Message Content intent.
Expand Down Expand Up @@ -77,7 +77,7 @@ apart from the note telling you who invoked it. A Slash Command's fields can acc

Just about as good as it gets.

### [Message](https://docs.pycord.dev/en/stable/api.html#messagecommand) and [User](https://docs.pycord.dev/en/stable/api.html#usercommand) Commands
### [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

Message Commands and User Commands were both introduced at around the same time, and are very similar to each other, so we'll be
introducing them together. These commands can be found in the `Apps` tab when alt-clicking. The only difference between the two is that
Expand Down Expand Up @@ -181,10 +181,10 @@ Message Components are fairly new features in Discord, allowing developers to gi
and understandable user interface. Message Components are easy to use and make your bot look modern,
sleek, and downright awesome.

### [Views](https://docs.pycord.dev/en/stable/api.html#discord.ui.View)
### [Views](https://docs.pycord.dev/en/stable/api/ui_kit.html#discord.ui.View)

Views are not an Application Command nor are they a Message Component. Views are the invisible placeholders, or grid,
that Message Components lie in. Views can have up to 5 [`Action Rows`](https://docs.pycord.dev/en/stable/api.html#discord.ActionRow),
that Message Components lie in. Views can have up to 5 [`Action Rows`](https://docs.pycord.dev/en/stable/api/models.html#discord.ActionRow),
and Action Rows can have a maximum of 5 slots. Below, you can find a table showing how many slots a Message Interaction takes up.

| Component | Slots |
Expand All @@ -197,7 +197,7 @@ So, based on this, you could have a maximum of 25 Buttons in a View with no Sele
Menus in a View with no Buttons. This doesn't mean you can't have them both in a View, however. You can have
a combination of them, such as 20 Buttons and a Select Menu or 10 Buttons and 3 Select Menus.

### [Buttons](https://docs.pycord.dev/en/stable/api.html#discord.ui.Button)
### [Buttons](https://docs.pycord.dev/en/stable/api/ui_kit.html#discord.ui.Button)

Buttons are the first of the Message Components. They allow for quick responses to prompts, such as for canceling or continuing an action.
Of course, these aren't their only uses; people have created awesome things with Buttons, such as calculators, games, and more!
Expand All @@ -218,7 +218,7 @@ Of course, these aren't their only uses; people have created awesome things with
This is what a Button looks like, very simple and modern. To learn more about Buttons, refer to our
[Buttons page](./ui-components/buttons.mdx).

### [Select Menus](https://docs.pycord.dev/en/stable/api.html#discord.ui.Select)
### [Select Menus](https://docs.pycord.dev/en/stable/api/ui_kit.html#discord.ui.Select)

Select Menus are the second of Discord's Message Components. They allow users to select from a list of choices, which your bot can then use.
Select Menus are good for things such as choosing features, pages of a help menu, and more.
Expand All @@ -229,7 +229,7 @@ This is what a Select Menu looks like. While not looking as good as Buttons, the
and have even greater possibilities. To learn more about Select Menus, please refer to our [Select
Menus page](./ui-components/dropdowns.mdx).

### [Modal Dialogs](https://docs.pycord.dev/en/stable/api.html#discord.ui.Modal)
### [Modal Dialogs](https://docs.pycord.dev/en/stable/api/ui_kit.html#discord.ui.Modal)

Text Modals are the most recently added Message Component in Discord. They're useful for text input and filling out forms, such as a
sign-up for your bot's service. These are meant to replace long bot setup processes by allowing users to fill out multiple text fields,
Expand Down
12 changes: 6 additions & 6 deletions docs/interactions/ui-components/buttons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ Using this command should return the following message:
<br />

As you can see, we create a class called `MyView` that [subclasses](#oop)
[`discord.ui.View`](https://docs.pycord.dev/en/stable/api.html#discord.ui.View).
[`discord.ui.View`](https://docs.pycord.dev/en/stable/api/ui_kit.html#discord.ui.View).

Then, we add a function called `button_callback` to the `MyView` class with the decorator
[`discord.ui.button`](https://docs.pycord.dev/en/stable/api.html#discord.ui.button).
[`discord.ui.button`](https://docs.pycord.dev/en/stable/api/ui_kit.html#discord.ui.Button).
This decorator adds a button to a component. This function takes two arguments: the button that was
clicked and the interaction. These arguments are passed to the function when the button is clicked
by the module. We use the [`interaction.response.send_message`](https://docs.pycord.dev/en/stable/api.html#discord.InteractionResponse.send_message)
by the module. We use the [`interaction.response.send_message`](https://docs.pycord.dev/en/stable/api/models.html#discord.InteractionResponse.send_message)
function to send a message to the channel where the interaction was sent.

Finally, we create a global slash command called `button` that sends the message, along with the view
Expand All @@ -101,11 +101,11 @@ about making your button do amazing things, while Pycord handles the rest!
| Danger | `discord.ButtonStyle.danger` / `discord.ButtonStyle.red` | Red |
| Link | `discord.ButtonStyle.link` / `discord.ButtonStyle.url` | Grey |

Check out the [`discord.ButtonStyle`](https://docs.pycord.dev/en/stable/api.html#discord.ButtonStyle) class for more information.
Check out the [`discord.ButtonStyle`](https://docs.pycord.dev/en/stable/api/enums.html#discord.ButtonStyle) class for more information.

![Different Button Styles](../../assets/interactions/button-styles.png)

You can set a button's style by adding the `style` argument in the [`discord.ui.button`](https://docs.pycord.dev/en/stable/api.html#discord.ui.button) decorator.
You can set a button's style by adding the `style` argument in the [`discord.ui.button`](https://docs.pycord.dev/en/stable/api/ui_kit.html#discord.ui.button) decorator.

```python
class MyView(discord.ui.View):
Expand All @@ -119,7 +119,7 @@ class MyView(discord.ui.View):
We have discussed that Views can have 5 rows. Each row has 5 slots, and each button takes up 1 slot.
So, how do we move the buttons to another row?

This can be done by specifying the `row` argument in the [`discord.ui.button`](https://docs.pycord.dev/en/stable/api.html#discord.ui.button)
This can be done by specifying the `row` argument in the [`discord.ui.button`](https://docs.pycord.dev/en/stable/api/ui_kit.html#discord.ui.button)
decorator.

:::info The `row` argument
Expand Down
Loading