feat: delete-all button and language dropdown for multi-message code blocks#550
Open
Neil-Tomar wants to merge 3 commits into
Open
feat: delete-all button and language dropdown for multi-message code blocks#550Neil-Tomar wants to merge 3 commits into
Neil-Tomar wants to merge 3 commits into
Conversation
…ching Delete-all button removes every message of a block; ephemeral language dropdown re-colors every chunk. Only the bot's own messages are touched.
danthe1st
requested changes
Jul 4, 2026
danthe1st
requested changes
Jul 5, 2026
danthe1st
requested changes
Jul 5, 2026
| * @return an action row containing the language dropdown | ||
| */ | ||
| public static ActionRow buildLanguageMenu(long requesterId, int total) { | ||
| return ActionRow.of(languageMenu(ComponentIdBuilder.build(COMPONENT_ID, requesterId, total))); |
Member
There was a problem hiding this comment.
I noticed it's possible to do the following:
- User A runs the format code command
- User B runs the format code command
- User A deletes the code they formatted
- User A changes the language from their ephemeral message
In this case, the language of the code block of user B is changed. Could you prevent this in one of the following ways?
- In
LinkedMessages.resolveAfter, check that the last message contains the delete button with the delete button with the correct requestor (= current user) and that no other messages have a delete button - Change the ephemeral message to be sent after the formatted codeblocks, use
resolveBeforeand add an additional argument containing the message ID of the first code block message to the ID here. If this doesn't match, it is a failure.
I think the first approach is easier to do so I recommend that one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Multi-message formatted code blocks now have two interactions, backed by a small message-linking helper:
How
Open questions