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)

Events

EventCategoryTrigger textExposesFires when
messageMessagesRequired, e.g. "!hello"message, userA message starts with the trigger text
member_joinServer EventsNonememberSomeone joins the server
member_leaveServer EventsNonememberSomeone leaves or is removed from the server
reaction_addReactionsNoneuser, reactionSomeone 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.

FunctionWhat it doesExample
length(x)Length of a string, list, or dictlength("hello") → 5
keys(d)List of a dict's keyskeys({"a": 1})["a"]
upper(s)Uppercase a stringupper("hi") → "HI"
lower(s)Lowercase a stringlower("HI") → "hi"
str(x)Convert anything to textstr(42) → "42"
int(x)Convert text or number to a whole numberint("7") → 7
float(x)Convert text or number to a decimalfloat("2.5") → 2.5
split(s, sep)Split a string into a listsplit("a,b", ",")["a", "b"]
join(list, sep)Join a list into one stringjoin(["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 foundindex_of("hi", "i") → 1
push(list, v)Add v to the end of a list, in placepush(list, 3)
pop(list)Remove and return the last item, in placepop(list) → 3

Bot Functions

Provided by the bot itself. This list can grow over time.

FunctionWhat 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.

NodeWhat it doesWorks with
Say somethingSends a message back to the channelAll events
Random numberPicks a random number and stores it in a variable you nameAll events
WaitPauses before the next node runsAll events
Admin checkSends one message to admins and another to everyone elseMessage, Reaction
If message contains a wordChecks whether the message text contains a word, with an optional otherwise messageMessage
Random message from a listPicks one line at random from a list you type, one message per lineAll events
Repeat a messageSends the same message a fixed number of times in a rowAll events
Shout somethingSends a message in ALL CAPSAll events
Whisper somethingSends a message in lowercaseAll events
Reply with the message's lengthCounts the characters in the message and includes the count in a replyMessage
Only reply sometimesRolls a percentage chance before sending a messageAll events
If the message is exactlyLike "contains a word", but requires an exact whole-message matchMessage
Only for a specific personSends a different message depending on the sender's exact usernameMessage, Reaction
Remember some textStores text in a variable you name, to reuse in later nodesAll events
Remember a numberStores a number in a variable you name, to reuse in later nodesAll events
Wait a random amount of timePauses for a random number of seconds within a range you setAll events
Repeat a random number of timesLike "Repeat a message", but the number of repeats is randomized each runAll events
Reply with the word countCounts the words (not characters) in the message and includes the count in a replyMessage
Do some math and replyAdds, subtracts, multiplies, or divides two numbers and includes the result in a replyAll events
React with an emojiReacts to the trigger message (or the reacted-to message, on a reaction event) with an emojiMessage, 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

SettingWhat it controls
Manager rolesWhich roles, beyond the server owner and Administrator/Manage Server, can create and edit commands
Command prefixThe prefix the built-in !ping, !info, and !config commands respond to. Does not affect your own commands' trigger text
Built-in commandsTurns ping, info, and config on or off individually for this server
Error log channelWhere the bot posts a short notice if a saved command hits an error while running

Built-in Bot Commands

CommandWhat it does
!pingReplies with the bot's current latency
!infoReplies with how many custom commands are enabled in the server
!configReplies 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

MessageWhat it means
Unexpected token ... at line NA 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 StringMath was attempted on text, check int() or float()
has no on message("...") handler matching the triggerThe 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 limitAlmost 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