# Frequently Asked Questions

Before, check you are using the correct library (`discord-components` not `discord-buttons`) and if your library is in [the newest version](https://pypi.org/project/discord-components/).

## How to make buttons inline?

Your code must be something like&#x20;

```python
await <discord.abc.Messageable>.send(
    ...,
    components = [
        Button(...),
        Button(...),
        Button(...)
    ]
)
```

You should use a two-dimensional array like below to make buttons inline.

```python
await <discord.abc.Messageable>.send(
    ...,
    components = [
        [
            Button(...),
            Button(...),
            Button(...)
        ]
    ]
)
```

## How do I remove components?

Simple. Edit the message with parameter `components` set to `[]`.

```python
msg = await <discord.abc.Messageable>.send(
    ...,
    components = [...]
)
interaction = await <discord.ext.commands.Bot or discord.Client>.wait_for("event")

# First option
await msg.edit(components = [])
# Second option
await interaction.edit_origin(
    components = []
)
```

## How do I ignore the interaction?

Just respond with the type `6` with no other parameters or defer with edit\_origin enabled.

## Global event

There is an event `on_button_click` and `on_select_option`. You can use this as normal events.

```python
@<discord.ext.commands.Bot or discord.Client>.event
async def on_button_click(interaction):
    if interaction.responded:
        return
    await interaction.send(content = "Yay!")

@<discord.ext.commands.Bot or discord.Client>.event
async def on_select_option(interaction):
    if interaction.responded:
        return
    await interaction.send(content = "Yay!")
```

There is [an example using cogs](https://gitlab.com/discord.py-components/discord.py-components/-/blob/master/examples/example_cog.py) on GitLab.

## TypeError: send() got an unexpected keyword argument 'components'

Have you put `DiscordComponents(<discord.Client or discord.ext.commands.Bot>)` inside the `on_ready` event or initialized the bot with `ComponentsBot`?

## Handle multiple interacts

You should put a while on `discord.Client.wait_for` to handle multiple clicks

```python
while True:
    interaction = await <discord.ext.commands.Bot or discord.Client>.wait_for("event")
    await interaction.send(content = "Wow")
```

## Disabling the components for specific users

This is impossible but you can ignore the interaction by putting a check.

```python
interaction = await <discord.ext.commands.Bot or discord.Client>.wait_for(
    "event",
    check = lambda i: i.user.id == "something"
)
```

## &#x20;**I get ''404 Not Found (error code: 10062): Unknown interaction''**

Check if you already responded to the interaction.

## Using custom emoji

You send a `discord.Emoji` object to the parameter. You can get the custom emoji by doing

```python
<discord.ext.commands.Bot or discord.Client>.get_emoji(849325102746042439)
```

## **Can I set my own colors for buttons?**

No. Try reading [this](https://github.com/discord/discord-api-docs/issues/3022).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devkiki7000.gitbook.io/discord-components/guide/frequently-asked-questions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
