Lumen Reference
A quick lookup for every event, function, node, setting, and error message. If you are learning Lumen for the first time, start with the Guide instead.
Download this reference as a Word document (.docx)
Nothing matches "".
Events
| Event | Category | Trigger text | Exposes | Fires when |
|---|---|---|---|---|
message | Messages | Required, e.g. "!hello" | message, user | A message starts with the trigger text |
member_join | Server Events | None | member | Someone joins the server |
member_leave | Server Events | None | member | Someone leaves or is removed from the server |
reaction_add | Reactions | None | user, reaction | Someone adds a reaction to a message |
Events with no trigger text fire on their own, so a server can only have one command per event of that kind. message commands each need a unique trigger, so a server can have as many as it wants.
Language Functions
Always available, regardless of what the bot itself provides.
| Function | What it does | Example |
|---|---|---|
length(x) | Length of a string, list, or dict | length("hello") → 5 |
keys(d) | List of a dict's keys | keys({"a": 1}) → ["a"] |
upper(s) | Uppercase a string | upper("hi") → "HI" |
lower(s) | Lowercase a string | lower("HI") → "hi" |
str(x) | Convert anything to text | str(42) → "42" |
int(x) | Convert text or number to a whole number | int("7") → 7 |
float(x) | Convert text or number to a decimal | float("2.5") → 2.5 |
split(s, sep) | Split a string into a list | split("a,b", ",") → ["a", "b"] |
join(list, sep) | Join a list into one string | join(["a", "b"], "-") → "a-b" |
contains?(x, v) | Does a string, list, or dict contain v? | contains?([1,2], 2) → true |
index_of(x, v) | Position of v, or nil if not found | index_of("hi", "i") → 1 |
push(list, v) | Add v to the end of a list, in place | push(list, 3) |
pop(list) | Remove and return the last item, in place | pop(list) → 3 |
Bot Functions
Provided by the bot itself. This list can grow over time.
| Function | What it does |
|---|---|
send(text) | Posts a message to the channel the trigger came from |
random(min, max) | A random whole number between min and max, inclusive |
wait(seconds) | Pauses briefly before continuing, capped at a few seconds |
react(emoji) | Reacts to the trigger message with an emoji |
Node Editor Blocks
Available in the Blocks view of the command editor. "All events" means the node works no matter which event the command uses.
| Node | What it does | Works with |
|---|---|---|
| Say something | Sends a message back to the channel | All events |
| Random number | Picks a random number and stores it in a variable you name | All events |
| Wait | Pauses before the next node runs | All events |
| Admin check | Sends one message to admins and another to everyone else | Message, Reaction |
| If message contains a word | Checks whether the message text contains a word, with an optional otherwise message | Message |
| Random message from a list | Picks one line at random from a list you type, one message per line | All events |
| Repeat a message | Sends the same message a fixed number of times in a row | All events |
| Shout something | Sends a message in ALL CAPS | All events |
| Whisper something | Sends a message in lowercase | All events |
| Reply with the message's length | Counts the characters in the message and includes the count in a reply | Message |
| Only reply sometimes | Rolls a percentage chance before sending a message | All events |
| If the message is exactly | Like "contains a word", but requires an exact whole-message match | Message |
| Only for a specific person | Sends a different message depending on the sender's exact username | Message, Reaction |
| Remember some text | Stores text in a variable you name, to reuse in later nodes | All events |
| Remember a number | Stores a number in a variable you name, to reuse in later nodes | All events |
| Wait a random amount of time | Pauses for a random number of seconds within a range you set | All events |
| Repeat a random number of times | Like "Repeat a message", but the number of repeats is randomized each run | All events |
| Reply with the word count | Counts the words (not characters) in the message and includes the count in a reply | Message |
| Do some math and reply | Adds, subtracts, multiplies, or divides two numbers and includes the result in a reply | All events |
| React with an emoji | Reacts to the trigger message (or the reacted-to message, on a reaction event) with an emoji | Message, Reaction |
The palette in the editor only shows nodes that make sense for whichever event is currently selected, so you will not see every row above at once.
Server Settings
| Setting | What it controls |
|---|---|
| Manager roles | Which roles, beyond the server owner and Administrator/Manage Server, can create and edit commands |
| Command prefix | The prefix the built-in !ping, !info, and !config commands respond to. Does not affect your own commands' trigger text |
| Built-in commands | Turns ping, info, and config on or off individually for this server |
| Error log channel | Where the bot posts a short notice if a saved command hits an error while running |
Built-in Bot Commands
| Command | What it does |
|---|---|
!ping | Replies with the bot's current latency |
!info | Replies with how many custom commands are enabled in the server |
!config | Replies with a link to this server's dashboard |
The ! shown here is the default prefix; it changes if you set a custom one in Server Settings.
Error Messages
| Message | What it means |
|---|---|
Unexpected token ... at line N | A typo or missing end, quote, or bracket near that line |
Undefined variable 'x' | A variable was used before it was assigned a value |
Expected a number, got String | Math was attempted on text, check int() or float() |
has no on message("...") handler matching the trigger | The trigger word does not match the on message(...) line (or, for events like member_join, the handler needs to be a zero-argument on member_join()) |
Script exceeded ... step limit | Almost always an infinite while loop, check the loop's condition |
| "This command's code doesn't match a pattern the block editor understands yet" | The Code view has something (a loop, a custom function, hand-written logic) that the Blocks view cannot represent. The code is left untouched |