Skip to content
1 change: 1 addition & 0 deletions docs/getting-started/creating-your-first-bot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ You can store your tokens in `.env` files. This is a simple way to store sensiti
TOKEN = [PASTE YOUR TOKEN HERE]
```


for example:


Expand Down
5 changes: 2 additions & 3 deletions docs/getting-started/more-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ First, you need to ask Discord to send you events. This is done via "Intents". R

Once you understand what intents are, you can enable the events you need, or just use the default ones with `discord.Intents.all()`.

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

```python
@bot.event
Expand Down Expand Up @@ -223,7 +223,7 @@ method, you can set a small image to reside at the top-right of the embed. This
- Image - With the [`set_image`](https://docs.pycord.dev/en/master/api.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, or a title and a description, and so on.
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.

### Markdown
Markdown is a type of markup language that's limited in terms of formatting yet simple. Discord allows
Expand Down Expand Up @@ -274,7 +274,6 @@ For code markdown, you can choose between `Code Text` and `Code Blocks`.

- \`Code Text\`
- \`\`\`

Code Blocks
\`\`\`

Expand Down
14 changes: 7 additions & 7 deletions docs/getting-started/rules-and-common-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ Providing a Terms of Service for your bot is optional, though usually a best pra
what they can and cannot do with your service, and makes it easier to settle disputes if someone
disagrees with you.

Read more in Discord's official [Legal Docs](https://discord.com/developers/docs/legal)
Read more in Discord's official [Legal Docs](https://discord.com/developers/docs/legal).

### Developer Policy

We could list almost every rule about using Discord's API here. *Or* we could simply link Discord's
developer policy to make it easier on us. You can find Discord's developer policy
Developer Policy to make it easier on us. You can find Discord's Developer Policy
[here](https://discord.com/developers/docs/policy). This outlines what you can and cannot do with
Discord's developer API. And, don't worry, it's completely readable and understandable.
Discord's Developer API. And, don't worry, it's completely readable and understandable.

## Best Practices

Expand Down Expand Up @@ -78,8 +78,8 @@ bot verification, so verifying as soon as possible gives them enough time to ver
reaches the 100 server cap. If a bot is not verified, it cannot grow beyond 100 servers.

It's also a good idea to only apply for the privileged intents that you need. Applying for intents
your bot doesn't use wastes both your time and Discord's time, as your whole verification request
can be denied simply because you applied for an intent you didn't need.
your bot doesn't use wastes both your time and Discord's time, as your privileged intent request
will be denied simply because you applied for an intent you didn't need.

### Subclassing

Expand All @@ -106,7 +106,7 @@ the Creating Your First Bot guide.
You always want to back up your bot's data. This includes both its code *and* its databases. This way,
if something tragic happens, such as your host failing a data migration or you breaking your Raspberry
Pi's SD card that held your bot, you'll still have its precious user data. I have a small program for
my bot that uploads its databases to a remote GitHub repository now and then to not lose any data.
my bot that uploads its databases to a remote GitHub repository every now and then to not lose any data.
It may be smarter to find a bit more of a reliable way to do so, though.

Public or private, having a local Git repository connected to a remote one is a good idea for making
Expand Down Expand Up @@ -169,7 +169,7 @@ works entirely on files. However, if for some reason you cannot read/write to an
lots of data, SQLite might not be for you.

While SQLite is a part of the Python Standard Library as the `sqlite3` package, we recommend not using it as it is
synchronous and blocking. You should use an asynchronous alternative, such as `aiosqlite`.
synchronous and blocking. You should use an asynchronous alternative, such as [`aiosqlite`](https://pypi.org/project/aiosqlite/).

#### PostgreSQL
PostgreSQL is also based on SQL, but it also has more features than SQLite. It's compliant with the SQL standard,
Expand Down
8 changes: 7 additions & 1 deletion docs/interactions/application-commands/context-menus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ import DiscordComponent, { defaultOptions } from "../../../src/components/Discor
When you right-click a message, you may see an option called "Apps". Hover over it and you can see
commands a bot can run with that message. These are called message commands.

When you right-click a message in the user list, you can once again see an option called "Apps".
When you right-click a user in the user list, you can once again see an option called "Apps".
Hover over it and you can see commands a bot can run with that message. These are called user commands.

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.

:::note

A bot can have up to 5 global Context Menus of each type.

:::

## User Commands

Creating a user command is very simple.
Expand Down
10 changes: 5 additions & 5 deletions docs/interactions/application-commands/slash-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ On March 24, 2021, Discord added Slash Commands to Discord as an easier, more ef

:::important

Remember that slash commands require your bot to be invited with the `application.commands` scope or slash commands will not show up. Bots already in the guild can simply be invited again with the scope; there is no need to kick the bot.
Remember that Slash Commands require your bot to be invited with the `application.commands` scope or Slash Commands will not show up. Bots already in the guild can simply be invited again with the scope; there is no need to kick the bot.

:::

Expand Down Expand Up @@ -70,16 +70,16 @@ We create an async function called `ping` with parameters `ctx`, which, when cal

## Subcommand Groups

You might want to group certain commands together to make them more organised. A command group is exactly what it sounds like, a group of individual slash commands together.
You might want to group certain commands together to make them more organised. A command group is exactly what it sounds like, a group of individual Slash Commands together.

In order to make a slash command group, you can use the `bot.create_group` function.
In order to make a Slash Command group, you can use the `bot.create_group` function.

```python
import discord

bot = discord.Bot(debug_guilds=[...]) # specify the guild IDs in debug_guilds

# create slash command group with bot.create_group
# create Slash Command group with bot.create_group
greetings = bot.create_group("greetings", "Greet people")

@greetings.command()
Expand Down Expand Up @@ -107,7 +107,7 @@ async def subtract(ctx, num1: int, num2: int):
sum = num1 - num2
await ctx.respond(f"{num1} minus {num2} is {sum}.")

# you'll have to manually add the manually created slash command group
# you'll have to manually add the manually created Slash Command group
bot.add_application_command(math)
```

Expand Down
146 changes: 73 additions & 73 deletions docs/interactions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ In December 2020, Discord released their first Interaction: the
[Slash Command](https://discord.com/developers/docs/interactions/application-commands#slash-commands).
Since then, Discord has added many different types of Interactions, including:

[**UI Components**](https://discord.com/developers/docs/interactions/message-components)

- [**Buttons**](https://discord.com/developers/docs/interactions/message-components#buttons):
Buttons are attached to a message and can be clicked on to perform an action.
- [**Select Menus**](https://discord.com/developers/docs/interactions/message-components#select-menus):
Drop-down menus are used to select a number of options from a list.
- [**Modals**](https://discord.com/developers/docs/interactions/message-components#text-inputs):
Form-like modals can be used to ask for input from a user.

[**Application Commands**](https://discord.com/developers/docs/interactions/application-commands)

- [**Slash Commands**](https://discord.com/developers/docs/interactions/application-commands#slash-commands):
Expand All @@ -36,71 +27,14 @@ Commands that can be used with the `/` prefix.
- [**Message Commands**](https://discord.com/developers/docs/interactions/application-commands#message-commands):
Commands that can be used on a message by alt-clicking/selecting it.

## Message Components

Message Components are fairly new features in Discord, allowing developers to give their bots a fast
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/master/api.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/master/api.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 |
| ------------ | ---------------------------- |
| Buttons | 1 Slot |
| Select Menus | 5 Slots |
| Text Modals | 1 Slot (opened via a Button) |

So, based on this, you could have a maximum of 25 Buttons in a View with no Select Menus, and 5 Select
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/master/api.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!

<DiscordComponent>
<DiscordMessage profile="robocord">
Discord Buttons are awesome!
<div slot="actions">
<DiscordButtons>
<DiscordButton type="primary" emoji="😎">Click me!</DiscordButton>
</DiscordButtons>
</div>
</DiscordMessage>
</DiscordComponent>

<br />

This is what a Button looks like, very simple and modern. To learn more about Buttons, refer to our
[Buttons page](./ui-components/buttons).

### [Select Menus](https://docs.pycord.dev/en/master/api.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.

![Select Menu Example Image](../assets/interactions/select-menus-example.png)

This is what a Select Menu looks like. While not looking as good as Buttons, they still look great
and have even greater possibilities. To learn more about Select Menus, please refer to our [Select
Menus page](./ui-components/dropdowns).

### [Modal Dialogs](https://docs.pycord.dev/en/master/api.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,
which avoids having the user send multiple messages for the bot. Modals can accessed by either invoking an Application Command or by
interacting with another UI Component.

![Text Modal Example Image](../assets/interactions/modal-example.png)
[**UI Components**](https://discord.com/developers/docs/interactions/message-components)

This is what a Text Modal looks like, easy to use and one of the most useful Message Components yet. To learn more about Text Modals,
please visit our [Modal Dialogs page](./ui-components/modal-dialogs).
- [**Buttons**](https://discord.com/developers/docs/interactions/message-components#buttons):
Buttons are attached to a message and can be clicked on to perform an action.
- [**Select Menus**](https://discord.com/developers/docs/interactions/message-components#select-menus):
Drop-down menus are used to select a number of options from a list.
- [**Modals**](https://discord.com/developers/docs/interactions/message-components#text-inputs):
Form-like modals can be used to ask for input from a user.

## Application Commands

Expand Down Expand Up @@ -240,3 +174,69 @@ your bot's reach, it'll have to use Application Commands.
Choosing which is the better option is up to you, if you're starting small. If
you plan on growing your bot, however, you will have to use Application Commands. Since prefix commands are slowly being phased out by Discord,
there isn't much of a choice for developers of larger bots.

## Message Components

Message Components are fairly new features in Discord, allowing developers to give their bots a fast
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/master/api.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/master/api.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 |
| ------------ | ---------------------------- |
| Buttons | 1 Slot |
| Select Menus | 5 Slots |
| Text Modals | 1 Slot (opened via a Button) |

So, based on this, you could have a maximum of 25 Buttons in a View with no Select Menus, and 5 Select
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/master/api.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!

<DiscordComponent>
<DiscordMessage profile="robocord">
Discord Buttons are awesome!
<div slot="actions">
<DiscordButtons>
<DiscordButton type="primary" emoji="😎">Click me!</DiscordButton>
</DiscordButtons>
</div>
</DiscordMessage>
</DiscordComponent>

<br />

This is what a Button looks like, very simple and modern. To learn more about Buttons, refer to our
[Buttons page](./ui-components/buttons).

### [Select Menus](https://docs.pycord.dev/en/master/api.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.

![Select Menu Example Image](../assets/interactions/select-menus-example.png)

This is what a Select Menu looks like. While not looking as good as Buttons, they still look great
and have even greater possibilities. To learn more about Select Menus, please refer to our [Select
Menus page](./ui-components/dropdowns).

### [Modal Dialogs](https://docs.pycord.dev/en/master/api.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,
which avoids having the user send multiple messages for the bot. Modals can accessed by either invoking an Application Command or by
interacting with another UI Component.

![Text Modal Example Image](../assets/interactions/modal-example.png)

This is what a Text Modal looks like, easy to use and one of the most useful Message Components yet. To learn more about Text Modals,
please visit our [Modal Dialogs page](./ui-components/modal-dialogs).
17 changes: 9 additions & 8 deletions docs/more/community-resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ This page showcases the amazing things created by the Pycord community, includin

## Plugins

| Name | Type | GitHub |
|------------|-------|-------------------------------------------------------------|
| Music Cord | Music | [NixonXC/cord-music](https://github.com/NixonXC/cord-music) |
| Name | Type | GitHub |
| --------------- | ------------ | --------------------------------------------------------------- |
| Music Cord | Music | [NixonXC/cord-music](https://github.com/NixonXC/cord-music) |
| pycord-i18n | Localization | [Dorukyum-pycord-i18n](https://github.com/Dorukyum/pycord-i18n) |
| pycord-multicog | Cogs | [pycord-multicog](https://github.com/Dorukyum/pycord-multicog) |

## Bots

| Name | Type | Link |
|--------------------------|--------------|-------------------------------------------------------------------------------------|
| ------------------------ | ------------ | ----------------------------------------------------------------------------------- |
| Discord-Multipurpose-Bot | Multipurpose | [github](https://github.com/pogrammar/Discord-multipurpose-bot/tree/master/Python) |
| *GZ* Global | Chatting | [website](https://www.gzglobal.eu/) |
| _GZ_ Global | Chatting | [website](https://www.gzglobal.eu/) |
| inconnu | Fun & QOL | [github](https://github.com/tiltowait/inconnu) |
| Mai | Multipurpose | [github](https://github.com/xFGhoul/Mai) & [website](https://xfghoul.github.io/Mai) |
| Pycord Manager | Multipurpose | [github](https://github.com/Dorukyum/Pycord-Manager) |
| PteroManager | Management | [github](https://github.com/EpikHost/PteroManager) |
| Mai | Multipurpose | [github](https://github.com/TeamMai/Mai) & [website](https://xfghoul.github.io/Mai) |
| Toolkit | Multipurpose | [github](https://github.com/Dorukyum/Toolkit) |