-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] ReRun py/pyi command if the message is edited #104
Comments
You can do this yourself, @bot.listen()
async def on_message_edit(before: discord.Message, after: discord.Message):
if before.content == after.content:
return
return await bot.process_commands(after) You can also limit this to the owner with |
No, because that would send a new result, not edit the original result. |
Maybe you can override commands.Context and edit the message with the new content if the message was edited, Not sure though. |
What if your evaluated code sends multiple messages before erroring? If your code works and sends something when it gets rerun, how show Jishaku know to edit the original message without modifying the Context class? (A custom Context class for Jishaku would conflict with any user-set Context classes, and monkeypatching is not a great solution for production code.) |
The Problem
Very frequently, I will write a long eval code and come across some error. This means I have to copy+paste my code, fix the error, and then resend it. This is spammy and slow.
The Ideal Solution
After running the py/pyi command, jiskaku will listen for the
on_raw_message_edit
event for the next 30 seconds on this specific message. If edited, rerun the py/pyi command, and instead of sending new output, edit the original message with the new output.The Current Solution
Copy+paste the eval command and resend it after fixing.
The text was updated successfully, but these errors were encountered: