CH

December 28, 2016

vpatch adding multi-channel support for trinque's ircbot and logbot

Filed under: common lisp, programming — Benjamin Vulpes @ 11:10 p.m.

Notice, January 8, 2017:

THESE VPATCHES DO NOT APPLY CLEANLY THROUGH A STRICT V IMPLEMENTATION

I discovered tonight that I ground these patches incorrectly. Full story in the logs (it is a short, must-read synopsis of a stupid mistake I made in grinding these vpatches).

Life's roadmap winds long, detours riddle it, dead-ends dog it, corndogs may be found in odd appendices along with the odd Coors Light. One of the waypoints (to relay blocks via irc to #chainstate on Freenode and to maintain my own #trilema logs) is an irc bot with multiple channel support. trinque did the bulk of the work with a 1-2 ircbot/logbot combo, for which I am pleased to present signed vpatches adding multiple-channel support.

replacement vpatches

I've taken these vpatches down to avoid confusion. You may find the originals at phf's viewer, and the updated versions at the replacement page.

ircbot

The changes to `ircbot' are relatively simple. I renamed the `channel' slot to `channels', and updated the connection/reconnection logic to map over the list of channels, connecting to each.

logbot

Surgery performed on logbot went a bit deeper:
- updated the schema definition such that messages sent over the `pg_notify' channel contain the message target (eg the IRC or handle to which a message is addressed) instead of the message text, so that the broadcasting process can relay it correctly
- updated `get-and-purge-outbox-messages' to accept a `target' parameter, which it uses to find the relevant outbox messages
- updated `logbot-send-outbox' to accept a `target' parameter
- updated the `logbot' class to use `channels' semantics in place of the previous `channel' semantics

I've been running this in production for a few weeks now, and it powers my loggotron. The thing currently doesn't record privmessages or ACTION items, so trinque's working on a patch that will save all raw protocol messages instead of parsing them into text and then selectively saving some.

1 Comment »

  1. [...] and I (but mostly trinque) have put some work into a Common Lisp IRC bot. Stand one up and keep it [...]

RSS feed for comments on this post. TrackBack URL

Reply

« vpatch adding multi-channel support for trinque's ircbot and logbot --- How to Fuck Up Without Being a Fuckup »