~ecs/quaternia

IRC bot to do random stuff
all: silently create necessary files
ping.go: formatting
Fix !snooze in PMs

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~ecs/quaternia
read/write
git@git.sr.ht:~ecs/quaternia

You can also use your local clone with git send-email.

quaternia

An IRC bot that does various things

Usage/Installation

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 nick, sasluser, saslpass, and channels.

You'll probably want to change opnick to your nick.

You can control quaternia's parser with the regex and regexsg options. It'll match all messages against regex, and use the regexsgth subgroup as the command that it interprets.

Commands

  • !ping: Write 'pong'. Useful for testing that the bot is responding.
  • !quit: Kill the bot. Only usable by opnick.
  • !wttr <location>: Get the weather in location using https://wttr.in.
  • !ddg <search>: Search DuckDuckGo for search. Due to limitations in the DuckDuckGo API, only returns instant answers. Some searches may cause weird errors.
  • !w <title>: Write the overview of the English Wikipedia article named title.
  • !ws <search>: Search the English Wikipedia for search.
  • !reload: Reload the configuration file.
  • !choose: Randomly choose one of the arguments.
  • !remind/!reminders/!remindme/!snooze: Something like https://git.sr.ht/~sircmpwn/reminderbot. Also triggered by most natural-language requests for reminders that start with 'remind me'.
  • !loc/!location: set/get user locations
  • !np: print the currently playing song, ignore arguments
  • !mpd: launch raw bytes at mpd, see https://musicpd.org/doc/html/protocol.html for documentation
  • !markov: print a Markov chain based on everything that quaternia has heard
  • !add <filter>, !album <album>, !artist <artist>, !clear, !prev, !skip/!next, !title: poke mpd in various ways

The music commands require an MPD intstance. It is recommended to put that instance on a server and configure the httpd output.

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 formatting string urlfmt ('%s' is replaced by the URL's title).

quaternia will also respond to messages containing "quaternia" with a Markov chain. You can pre-train quaternia's Markov chains by running ./train < [file containing a list of lines] > /etc/quaternia/markov.json.