Zirak / SO-ChatBot

Other
124 stars 60 forks source link

Cache last N messages per room to enable sed functionality globally. #232

Closed Shmiddty closed 8 years ago

Shmiddty commented 9 years ago

The title speaks for itself.

CS1000 commented 9 years ago

Can't it just read last 100 messages in the room it was invoked and return the first one that can be replaced?

Cache smells leaky...

SomeKittens commented 9 years ago

@CS1000 currently, it reads the DOM for the !!s command. It can only read the DOM for the room that's currently up in the tab.

CS1000 commented 9 years ago

what about reply-ing to a message like:

:2709976 s/search/replacement/gi

instead of !!s

Shmiddty commented 9 years ago

@CS1000 That's not a bad idea, but I don't think it solves the cross-room problem.

CS1000 commented 9 years ago

@Shmiddty it would requre fetching the exact message id, abuse shouldn't be a problem with a timed execution. http://chat.stackoverflow.com/messages/22491127/history

Zirak commented 8 years ago

Replacing a specific message was handled in #220 though we still use the DOM. Honestly, anything to do with messages that isn't in the current DOM is blocked on the same thing #27 (and many more things) are blocked on: Specifically how the bot has no internal representation of the room it's in or the chat in general.

Zirak commented 8 years ago

owait, this is a duplicate of #216.