An IRC bot that does various things
doas mkdir /etc/quaternia chown $USER /etc/quaternia cp quaternia.ini.example /etc/quaternia/quaternia.ini $EDITOR /etc/quaternia.ini make ./quaternia
You'll need to change
You'll probably want to change
opnick to your nick.
You can control quaternia's parser with the
options. It'll match all messages against
regex, and use the
regexsgth subgroup as the command that it interprets.
.ping: Write 'pong'. Useful for testing that the bot is responding.
.quit: Kill the bot. Only usable by
.w <location>: Get the weather in
.ddg <search>: Search DuckDuckGo for
search. Scrapes the HTML version of DuckDuckGo, might be broken by the time you're reading this.
.ia <search>: Get DuckDuckGo instant answers for
search. Some searches may cause weird errors.
.wp <title>: Write the overview of the English Wikipedia article named
.ws <search>: Search the English Wikipedia for
.reload: Reload the configuration file.
.choose: Randomly choose one of the arguments.
.snooze: Something like https://git.sr.ht/~sircmpwn/reminderbot. Also triggered by most natural-language requests for reminders that start with 'remind me'.
.location: set user locations
.markov: print a Markov chain based on everything that quaternia has heard
.go: execute Go code
.gocommit: start, abort, and commit a transaction of persistent Go commands
.mbta: get predictions from the MBTA API
.stops: get the stop IDs on an MBTA route
.rss: manage RSS subscriptions
Persistence is done with textual files under /etc/quaternia, because SQL is overkill for this and adds a runtime dependency.
quaternia will also print information on URLs mentioned, using the
urlfmt ('%s' is replaced by the URL's title).
quaternia will also respond to messages beginning with its nick followed by a
':' or ',' with a Markov chain. You can pre-train quaternia's Markov chains by
./train < [file containing a list of lines] > /etc/quaternia/markov.json.