References
A reference is how you tell a condition, filter, or action which parameter to use.
Everything you build points at something. A reference is the pointing.

The "which one?" question
Take the Delete action. It deletes a message - but which message?
That's what the reference answers. When you add the action, it asks you to pick a message, and you choose the one you mean.
Same for conditions. "Message contains 'hello'" - which message? Same for filters. "Ignore bots" - the bot check has to be pointed at a user, because - is the user a bot?
Why it isn't always obvious
If every event carried exactly one message and one user, references would be pointless - there'd only ever be one answer.
But events often carry several things of the same kind. From Understanding Events and Parameters Page, a Message Edit event gives you:
message- the message as it is nowmessage_before_edit- how it looked beforemessage_replied_to- the older message it's replying to
Three messages. "Message contains 'hello'" means three completely different things depending on which one you point it at:
message
Does the new version contain "hello"?
message_before_edit
Did the old version of the message (before it was edited) contain it?
message_replied_to
Does the message being replied to contain it?
Same condition. Three different features.
Read the reference picker before you move on. The default is usually right, but when it isn't, everything downstream is quietly wrong - and it'll look like the condition is broken rather than mis-aimed.
Some things need more than one reference
Forward is a good example. It forwards a message to a channel, so it asks you twice:
Which message should be forwarded? Which channel should it go to?

Two references, two different types. The same shape shows up anywhere an action involves two things - moving something from A to B, or comparing one thing to another.
Two limits worth knowing
Filters only ever see the event's own parameters. Custom parameters haven't been fetched yet when filters run, and no action has happened, so neither can appear there.
Action references
Most actions just do their job and finish. Some hand something back, and that result becomes available to the actions below.
These are called action references.
Examples:
Send Message (in a channel)
Message - The message it just sent
Create Invite
Invite - The invite it just created
When you add one of these actions, it offers to expose its result and lets you name it. Once named, it appears in the reference pickers of every action below it - and its details are available as Values in Expressions too, so you can use things like the sent message's ID or link.
The two rules
Last updated