Skip to content

Pipeline plugin

JR edited this page Mar 3, 2023 · 6 revisions

On Posix systems (Linux, macOS, similar) the Pipeline plugin gets compiled. It creates a special file (a named pipe, or FIFO) to which you can pipe text to either send commands to the server, or to control the bot. It will be named [bot name]@[server address] and is usually placed in /tmp, but this can be overridden to place it in the working directory via the fifoInWorkingDir setting.

To the server

Sending strings to the server is as easy as just piping strings into the fifo. Assuming a nickname of kameloso and a server of irc.libera.chat;

$ echo "PRIVMSG #channel :Hello world!" > kameloso@irc.libera.chat

To the bot

Strings that begin with a : colon are treated differently and are broadcasted to plugins. As of time of writing (2018-12-23), only the Admin plugin listens to commands piped this way.

  • :admin status: (debug) Prints some runtime information about the current bot.
  • :admin users: (debug) Prints a list of all known (tracked) users.
  • :admin user [nickname]: (debug) Prints the known information about a given user.
  • :admin state: (debug) Prints the Admin plugin's current state.
  • :admin printraw: (debug) Enables printraw, which prints all incoming server strings unmodified.
  • :admin printbytes: (debug) Iterates through the contents of received events character by character and prints them (with their ASCII codes).
  • :admin printasserts: (debug) Formats an assert block for incoming events, for easy copy-and-pasting into test modules.
  • :admin set: Change a plugin setting by name. Note that enabling plugins that were disabled at program start may not necessarily work.
  • :admin save: Saves current configuration to disk.
  • :admin reload: Asks all plugins to reload. What this does is implementation-defined.
  • :admin whitelist [add|remove|list] [channel] [account]: Adds or removes an account from the whitelist of users in a channel.
  • :admin operator [add|remove|list] [channel] [account]: Adds or removes an account from the operators in a channel.
  • :admin staff [add|remove|list] [channel] [account]: Adds or removes an account from the staff in a channel.
  • :admin blacklist [add|remove|list] [channel] [account]: Adds or removes an account from the blacklist of users in a channel.
  • :admin summary: Prints a connection statistic summary.
$ echo ":admin whitelist add #channel joe" > /tmp/kameloso@irc.freenode.net
$ echo ":admin blacklist add #other fred" > /tmp/kameloso@irc.freenode.net
$ echo ":admin set printer.enabled=false" > /tmp/kameloso@irc.freenode.net
$ echo ":admin save" > /tmp/kameloso@irc.freenode.net