How i can remove embed from message?

I need remove embed from message, i edit message with embed and after edit embed still on message
Solution:
You need to set the embeds property to an empty list embeds = mutableListOf()...
Jump to solution
9 Replies
Solution
gdude
gdude2mo ago
You need to set the embeds property to an empty list embeds = mutableListOf()
Zorinov
ZorinovOP2mo ago
But with buttons? components?
gdude
gdude2mo ago
can you be more specific on what you're doing?
Zorinov
ZorinovOP2mo ago
Confirm menu, when user press button opens modal window with text parameter. After closing modal windows sending message with confirmation With 2 buttons, accept and cancel. When press accept i edit message to text like "Creating ticket"
gdude
gdude2mo ago
OK, so you sent a message previously, and you want to edit that message when someone submits a modal you'll need to store a reference to that message somewhere (or retrieve it by ID) and edit it directly so, eg,
lateinit var mainMessage: Message

mainMessage = createMessage { // Or respond {
components {
publicInteractionButton(::MyModal) {
action { modal ->
mainMessage.edit { embeds = mutableMapOf() }
}
}
}
}
lateinit var mainMessage: Message

mainMessage = createMessage { // Or respond {
components {
publicInteractionButton(::MyModal) {
action { modal ->
mainMessage.edit { embeds = mutableMapOf() }
}
}
}
}
maybe something like this
Zorinov
ZorinovOP2mo ago
I need change the response message
gdude
gdude2mo ago
Well, you can update content instead of embeds content = "..." This approach only works for public messages, though if you're using ephemeral messages, you'll need to do this another way
empemeralSlashCommand {
action command@{
edit {
components {
publicInteractionButton(::MyModal) {
action { modal ->
edit@command {
content = "..."
}
}
}
}
}
}
}
empemeralSlashCommand {
action command@{
edit {
components {
publicInteractionButton(::MyModal) {
action { modal ->
edit@command {
content = "..."
}
}
}
}
}
}
}
something like that maybe
Zorinov
ZorinovOP2mo ago
After editing buttons still on message
No description
No description
gdude
gdude2mo ago
it's the same thing, components = mutableListOf()

Did you find this page helpful?