Git Product home page Git Product logo

Comments (8)

kelunik avatar kelunik commented on June 18, 2024

Can it also delete a tweet again? :P

from jeeves.

PeeHaa avatar PeeHaa commented on June 18, 2024

It will only delete chat messages, but if you need / want drunk tweet protection I could probably implement something for !!tweet as well.

from jeeves.

PeeHaa avatar PeeHaa commented on June 18, 2024

Now that I think about it we probably want plugins to have an undo method which undos whatever it is it has done cc @DaveRandom

from jeeves.

kelunik avatar kelunik commented on June 18, 2024

I don't think it's worth implementing it for all plugins. Every plugin would have to keep state of their actions. For plugins that only fetch information and post messages, we could handle that at a higher level. Deleting tweets or something like that obviously needs its own implementation.

from jeeves.

DaveRandom avatar DaveRandom commented on June 18, 2024

@kelunik we can have it work for plugins like this maybe:

  1. user issues !!undo <message link or id>
  2. fetch some info about the message (ID/content etc) and puts it into a VO.
  3. delete the message
  4. invoke Plugin#onUndo($messageInfo): Promise with a try/catch guard. Plugin may do any additional cleanup such as deleting a tweet, which it can figure out from the message info passed. A default implementation will be provided in BasePlugin which is just return new Success;

from jeeves.

PeeHaa avatar PeeHaa commented on June 18, 2024

It would be sexy if !!giphy does a move (to the gifbin) instead of a delete.

I'm annoying for bringing this up aren't I? :)

from jeeves.

DaveRandom avatar DaveRandom commented on June 18, 2024

@PeeHaa that could still work with a slight refactoring of the above, i.e. invoke Plugin#onUndo() first and make the default action cancellable

from jeeves.

DaveRandom avatar DaveRandom commented on June 18, 2024

Implemented as !!remove.

Deleting tweets is a separate issue that as yet has not been needed.

from jeeves.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.