rerun command to re-execute commands from replied messages (with intact content, attachments, etc.)#251
Merged
scarletcafe merged 9 commits intoJan 27, 2026
Conversation
Adds a 'rerun' command to re-execute a command from a message.
Owner
|
Looks well thought out and in style, thanks. Check errors seem to be spurious error from a sphinxcontrib-trio bug @ python-trio/sphinxcontrib-trio#399 , can ignore these and see if there is a solution upstream later. |
scarletcafe
approved these changes
Jan 27, 2026
Contributor
Author
|
yayyyy ❤️ also woah i didn't notice that issue that's great! |
Contributor
Author
|
small typo in the documentation 😭 fixed in #252 thanks ❤️ |
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.
Rationale
I was programming a command that takes attachments and I found myself having to resend attachments and copy the same contents over and over again as I made changes to the code. This became super tedious and I thought about making a command on my bot to do this but then realize it's actually really useful and I could create a PR for it
There are other really useful use-cases too, for example if you have a bunch of jsk scripts pinned in a channel like me you can easily re-run them with just the message ID without having to copy-paste (or resend any attachments). It's also really nice if you had nitro before when you sent a command but no longer have the extra characters to resend it again.
Aside from attachments it's just really nice to have a way to rerun a command, perhaps even as a different user or in a different channel, without having to copy its contents every time. It piggybacks off of the
jsk execcommand so the overrides and behaviors are the same.It could also be useful for running commands with embeds (if you override a bot's message) to test stuff
Summary of changes made
jsk reruncommand to rerun a command from a message without needing to copy-paste or resend attachments/other contextual entities. Similar syntax to thejsk execcommand, allows overriding and bypassing.messageargument (url, id, etc.) that MessageConverter convertsjsk overridecommandreruncommand implementation depends on this to workscroll for demo!
Checklist
Demonstration
1. unit tests
2. fixed long time bug preventing member mentions in the exec command (old vs new)
3. rerunning a command by replying without having to resend attachment
3. rerunning command by message id (same channel)
4. bypassing checks (also rerunning by channelid-messageid pair)
5. here i edited an old message and reran the command with the same attachments