Skip to content

change nickname on a modal #9085

Answered by tailoric
k3nnyburger asked this question in Q&A
Nov 25, 2022 · 1 comments · 5 replies

You must be logged in to vote

You have the pieces already here.
But you are not giving enough context to help you.
The original code does what you want. It will edit the nickname of a server member when done inside a guild.
To protect against it being used outside of a guild (server) you can use the decorator @guild_only.
Discord expects you to give a response to the modal submission.
Editing a user is not a response in regards to the interaction, (discord doesn't know that you did that edit because of the submit button click in the modal) you need to do something with the interaction.response. Something you could do is doing interaction.response.send_message("Changed your nickname", ephemeral=True) to show a message …

Replies: 1 comment 5 replies

You must be logged in to vote
5 replies
@k3nnyburger

@tailoric

@k3nnyburger

@tailoric

Answer selected by k3nnyburger
@k3nnyburger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants