Please tell me how to add buttons to a message that will be sent to another channel.
Example: a user writes a command !nick [name] to change the name. After that, a message with buttons is sent to the administration channel with a request to change the user's nickname. The administrator clicks on the "Accept" or "Reject" button and thereby changes the user's nickname.
I know how to send a message to another channel, but I don't know how to add buttons to this message
EDIT: I prefer the disnake.py package over discord.py because discord.py hadn't been fully upgraded when Discord rolled out Application Interactions. (For those that may know more, Danny had left discord.py and wasn't going to be upgrading it, so I learned disnake.py instead. Danny has since come back and done a tremendous job with discord.py, but I never switched back. They're very similar with only minor nuances. An understanding of discord.py should be proficient to understand the disnake.py coding)
This would be the last line, where the bot sends the buttons for the user to interact with. You'll see
components, you can also havecontentfor words to be displayed,embedif you want to attach an embed to send, or evenembedsif you have a list of embeds you want to send (up to 10). Here I have justcomponentsbecause I want you to see just how to add the buttons.Each button has the minimum arguments to define the button.
label,style, andcustom_id.In addition to this code that displays the buttons, you will also need something that listens for the button clicks.