For the complete documentation index, see llms.txt. This page is also available as Markdown.

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?

Every condition, filter, and action that works on something has a reference picker. It's usually the first thing it asks you for.

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 now

  • message_before_edit - how it looked before

  • message_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:

Pointed at
The check becomes

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.

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:

Action
Hands back

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

1. Only actions below can use it. The result doesn't exist until the action has run, so anything above it can't see it. Order matters.

2. Actions only. Filters and conditions have already finished by the time any action runs, so action references never reach them.

Last updated