Can deferEdit have ability to modify allowedMention as well? #2170
-
Hello, it's first time to use JDA, just started to use it days ago. I'm trying to perform message with Discord SlectMenu, Button, etc. I made my own class, so that bot can handle component interactions like below public void performInteraction(GenericComponentInteractionCreateEvent event) {
MessageChannel ch = event.getChannel();
Guild g = msg.getGuild();
//... After some codes
event.deferEdit()
.setContent("Text with role ping") //Text is example
.setActionRows(getComponents(g))
.queue();
//... Other codes here
} I made message not ping any roles or members when creating message like below ch.sendMessage("Text with role ping") //Text is example
.allowedMneitons(new ArrayList<>())
.setActionRows(//Add Components)
.queue(); I now have problem when use this code that if I use one of component in this message, bot will change role ping depending on SlectMenu that I added. Problem is that it starts to ping role even though I made it not do that. Actually, the reason why first code block lacks method about allowed mention is because So I wonder if there's way to make my bot not ping (even though editing message doesn't give mentions, but still) role/members when using event.deferEdit()
.setContent("Text with role ping") //Text is example
.setActionRows(getComponents(g))
.allowedMentions(new ArrayList<>())
.queue(); |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You should use .deferReply() instead of deferEdit() |
Beta Was this translation helpful? Give feedback.
-
That creates new message while I want to edit original message. |
Beta Was this translation helpful? Give feedback.
-
With the Message Rework (#2187), you should be able to modify allowed mentions on every edit request. |
Beta Was this translation helpful? Give feedback.
With the Message Rework (#2187), you should be able to modify allowed mentions on every edit request.