Frequent questions

Before asking a question, look at these :)

Before, check you are using the correct library (discord-components not discord-buttons) and if your library is in the newest version.

Select is not visible.

Selects are currently (2021.6.5) visible only for beta users so normal users can't see the component. But you can see selects on ephemeral messages!

How to make buttons inline?

Your code must be something like

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

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

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

How do I remove components?

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

How do I ignore the interaction?

Just respond with the type 6 with no other parameters.

Handle all interactions

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

Using with cogs.

There is an example using cogs on GitHub.

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

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

Handle multiple clicks

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

Disabling the components for specific users

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

Last updated

Was this helpful?