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.



Overview
This adds the slash command
/messagewith the following subcommands:raw, the bot shares the raw content of a given messagepost(andpost-with-message), the bot posts the given message in a channel of choice under its own nameedit(andedit-with-message), the bot edits a message previously posted under its own nameThis is mostly meant for administrative purposes, for example to post official messages like announcements or also rules.
Config Changes ❗
This technically has no config changes but I tagged it so whoever does the release doesnt forget the following:
This PR adds new slashcommands that are intended for administrative use only. Discord permissions should be setup to hide these commands from regular users!
Review
Code-wise it is quite similar to the existing
TagManageCommand. Structurally it starts with the setup, then helpers, then the actual flows for each subcommand and last but not leastSubcommandas helper enum.The flows themselves start with parsing their options and then have their logic. JDA makes the queuing a bit annoying as usual but should be understandable mostly. For the sake of being able to treat errors individually and abort the rest-queue in between, there are several
queue(...)calls instead of a single pipeline (also seeTagManageCommandwhich handles it in a similar way).I havent found a fitting package, so I gave it a new one. Not super happy with that choice as its just a single file (for now) but its probably the best approach in this case.
No unit tests for now, but creating some should be relatively straightforward.
Testing impressions
raw
post
post-with-message
edit
edit-with-message
edit foreign
Attempting to edit a foreign message: