> For the complete documentation index, see [llms.txt](https://docs.nighty.one/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nighty.one/custom-features-tab/references.md).

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

<figure><img src="/files/fDkAQUOz0hAz8Zv02wty" alt=""><figcaption></figcaption></figure>

## 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?&#x20;

{% hint style="info" %}
**Every condition, filter, and action that works on something has a reference picker.** It's usually the first thing it asks you for.
{% endhint %}

## 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](/custom-features-tab/understanding-events-and-parameters.md), 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.

{% hint style="warning" %}
**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.
{% endhint %}

## 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?

<figure><img src="/files/WAVdVgWUT9k21r66KSEO" alt=""><figcaption></figcaption></figure>

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

{% hint style="info" %}
**1. Only actions&#x20;*****below*****&#x20;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.
{% endhint %}
