change nickname on a modal #9085
-
I wanted to change my modal a nickname but unfortunately do not know exactly how this is my code
as mentioned before i would like to change the nickname of the user after sending the modal so far I have only tried that and found nothing about it
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You haven't really described the problem you encounter with your code. Other things to consider.
|
Beta Was this translation helpful? Give feedback.
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 doinginteraction.response.send_message("Changed your nickname", ephemeral=True)
to show a message …