Flow reference: Messages

Read Recent Messages

Read the last messages of a channel into {history.text} ("name: content" lines), {history.count}, {history.lastAuthorId} and {history.lastAt}.

Read the last messages of a channel into {history.text} ("name: content" lines), {history.count}, {history.lastAuthorId} and {history.lastAt}.

When and how to use it

Connect the input from the preceding step on the path that should perform this operation.
Fill the fields with data available in the trigger's context.
Connect the needed outputs; an unconnected path cannot run later blocks.

Configuration fields

Channel (blank = current) — channel


Choose the channel this block targets or filters. Use its Discord ID or a supported channel variable. Check channel overrides for the bot.

Input: Text.

Default: ``.


How many (1-50) — limit


Maximum count returned or allowed by this operation. For a guard, combine it with the time window; for a list, keep output readable.

Input: Number.

Default: 20.


Only from member (blank = everyone) — user


Choose the target user. {user} may be a command's selected user; {author} is the caller. Use an ID or the variable picker rather than a display name.

Input: Text.

Default: ``.


Include bot messages — includeBots


Turn on to keep messages of bots (including this bot) in the result; off reads members' messages only.

Input: On/off switch.

Default: false.

Outputs and next steps

out: Continue to the next step.

Test and troubleshoot

Invoke the correct trigger with simple inputs and verify the expected effect. Confirm variables exist on this path. A preview alone does not verify Discord delivery.

Save, validate and publish. Perform one real test and read the first relevant log error. [Testing](/docs/flow-testing) · [Variables](/docs/flow-variables) · [Permissions](/docs/flow-permissions).