rikai / Showbot

🤖 An omnipresent multi-platform bot who's goal in life is become Skynet 🤖
MIT License
40 stars 18 forks source link

Implement 'silent mode' #64

Open rikai opened 7 years ago

rikai commented 7 years ago

A silent mode, where the bot receives commands, but does not output a response would be extremely useful for debugging things under a similar load to a real bot.

Probably one of the easiest ways to track down #61 would be to run a second bot in the same channel in this mode, so it's under similar load without interfering with the main bot's functionality.

Note: This shouldn't just neuter commands, it should try to implement as much as possible, including sending the messages, without the messages actually getting sent, to be as faithful as possible to the setup being debugged.

So maybe something that intercepts/redirects sent messages to stdout instead of irc when the event is fired or something, rather than than stopping messages from being sent at all. Feel free to sanity check me on this though, just thinking myself that the later in the process this is done, the better it will be for debugging.

cbojar commented 7 years ago

Since this would be a completely separate issue, maybe run it behind ZNC and use something like https://github.com/gongo/znc-rom.

rikai commented 7 years ago

I refuse to touch ZNC, but nelsk might be willing to do so for debugging... :P

eriknelson commented 7 years ago

@rikai Yeah let's make nelsk deal with it :+1:

rikai commented 7 years ago

@cbojar @eriknelson TBH, i think adding another thing into the chain is a worse idea than handling it internally, even if i didn't dislike ZNC. :P

eriknelson commented 7 years ago

It should be easy to monkey patch cinch to write output to a logger.

rikai commented 7 years ago

If anyone feels like picking up where @herbmillerjr left off in #76 we can probably get this one knocked out.

The TL;DR from that issue is that the place where the message is caught needs to be moved to a later position and that there needs to be a way to whitelist plugins to bypass this to minimize breakage of things like cinch-identify.