How can I embed buttons to my message using discord.py?

581 Views Asked by At

I am making a discord bot using discord.py (with slash commands), but I am stuck on embedding buttons to my message. I can send the messages fine but once I try to put embeds there is always an error.

I've tried using: from discord_components import Button

But here's the error message:

from discord_components import Button

ModuleNotFoundError: No module named 'discord_components'

I've looked into many SO questions but most of the answers don't work (ModuleNotFoundError) or do not support slash commands

Note: if it helps, I'm using replit as my IDE.

1

There are 1 best solutions below

0
Matt On

Your import might be wrong, try this.

from discord.ui import Button, View