Skip to main content
All functions are accessed through the flume module.

flume.event

Subscribe to IRC events.
FunctionDescription
flume.event.on(name, callback)Register an event handler
flume.event.off(name)Remove your handlers for an event
The callback receives an event table/dict with fields specific to each event type. See Events for the full list.

Event Cancellation

Scripts can cancel events to suppress default processing: Lua:
flume.event.on("message", function(e)
    if e.text:find("spam") then
        e:cancel()  -- suppress this message
    end
end)
Python:
def on_message(e):
    if "spam" in e.get("text", ""):
        e["_cancel"] = True

flume.event.on("message", on_message)

flume.channel

Channel operations.
FunctionDescription
flume.channel.say(server, target, text)Send a message
flume.channel.join(server, channel, key?)Join a channel
flume.channel.part(server, channel, message?)Leave a channel

flume.buffer

Buffer operations.
FunctionDescription
flume.buffer.print(server, buffer, text)Print text to a buffer
flume.buffer.switch(buffer_name)Switch active buffer
Use "" for server and buffer to target the currently active ones.

flume.command

Register custom slash commands.
FunctionDescription
flume.command.register(name, callback, help_text)Register /name command
flume.command.unregister(name)Remove a command
The help_text is shown when users type /help name.
flume.command.register("greet", function(args)
    flume.buffer.print("", "", "Hello " .. args .. "!")
end, "Greet someone by name")

flume.config

Per-script persistent configuration. Stored as TOML in ~/.config/flume/scripts/<scriptname>.toml.
FunctionDescription
flume.config.get(key)Read a config value
flume.config.set(key, value)Write a config value
Supports strings, integers, floats, and booleans.

flume.server

Server operations.
FunctionDescription
flume.server.send_raw(server, line)Send a raw IRC line

flume.ui

UI operations.
FunctionDescription
flume.ui.notify(message, level?)Send a desktop notification