Skip to content

Re-evaluate snippet with emoji reaction #676

Closed

Description

@Akarys42

Abstract

It would be nice to be able to re-evaluate the same snippet if it has been edited, using the same message via an emoji interaction.

Specification

An emoji like this one 🔄 should be added to every evaluated user message, and if the user react with the same emoji on his message (along with the bot), a new eval task should trigger with the updated message content. If the message content wasn’t updated since last eval, the new eval task should silently cancel. Either way, the user reaction should be deleted and be ready to be re-evaluated again, once the last eval have finished.

Rationale

For now, when a eval didn’t go as plan, the user need to copy the snippet, paste it, modify it, and then send it. This take some time and some place in the chat, plus copy pasting text with markdown can be quite frustrating. Let’s make it easier!

Activity

  1. added
    a: utilityRelated to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils)
    on Dec 2, 2019
  2. changed the title [-]Re-evaluate message with emoji reaction[/-] [+]Re-evaluate snippet with emoji reaction[/+] on Dec 2, 2019
  3. ikuyarihS commented on Dec 4, 2019

    @ikuyarihS
    Contributor

    I think this is a good idea, specially for people who can make mistakes in the eval when typing directly like me - it will be very useful to just delete bot's messages, press up arrow, edit a few typo and react 🔄 to re-evaluate the code.

    One security concern comes to mind - if use keeps adding and removing 🔄 how will you stop the bot from evaluate the code over and over? ( I assume 🔄 is reacted by bot, so user can easily spam click on it )

  4. Akarys42 commented on Dec 4, 2019

    @Akarys42
    ContributorAuthor

    A simple cooldown should be enough, like maximum two re-eval per 10 seconds, right?

  5. Akarys42 commented on Dec 25, 2019

    @Akarys42
    ContributorAuthor

    Hi, can I work on it?

  6. MarkKoz commented on Dec 25, 2019

    @MarkKoz
    Contributor

    Don't show the reaction if the message is not edited. After a re-run, remove the reaction. Add it back if the message is edited once again.

    A 10 second cooldown sounds reasonable.

  7. added
    s: WIPWork In Progress
    t: featureNew feature or request
    and removed on Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: utilityRelated to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils)p: 3 - lowLow Prioritys: WIPWork In Progresst: featureNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions