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

Actions

Filters let the event in. Conditions confirmed it's the one you wanted. Actions are where you finally tell Nighty what to do about it.

Actions run in order, top to bottom

Your actions are a list, and Nighty works through it one at a time, from top to bottom. Each action finishes completely before the next one starts.

So the order you put them in is the order they happen in. If you send a message and then react to it, the message exists by the time the reaction happens. Flip them around and it doesn't.

Three things that follow from this:

If one action fails, the rest still run. Say your second action tries to delete a message that's already gone. It fails, the reason goes into your feature's log, and Nighty moves straight on to the third action. One broken step doesn't throw away the whole list.

Slow actions hold up the queue. Anything that takes time - waiting, fetching, running a slash command - blocks the actions below it until it's done. Usually that's exactly what you want, and it's what makes the Wait action useful.

Using the result of an action

Some actions hand you something back that later actions can use - an Action Ref:

This unlocks a lot. Once Send Message hands you the message it sent, later actions can react to it, edit it, pin it, or delete it - all in the same run.

Example - a self-deleting notice:

1

Send Message

"Cleaning up in 10 seconds" Expose an action ref

2

Wait

10 seconds

3

Delete

The message from step 1.

Example - post an invite:

1

Create Invite

Expose a ref to the invite

2

Send Message

Include the invite's link in the text using Expressions.

Remember the ordering rule: you can only use a result after the action that produced it. Put them in the right order.

Last updated