# Sticky messages

Source: https://righteousbot.dev/docs/features/sticky-messages/

Keep a message at the bottom of a busy channel, and choose how often it re-posts.

A sticky message is an [embed code](/docs/features/embed-codes/) plus a number. Once that many
messages have gone by, Righteous posts the code again at the bottom of the channel and deletes the
copy above. To post on a clock instead, use [auto messages](/docs/features/auto-messages/).

<Callout type="error" title="Sticky messages are Server Premium">
  [`,stickymessage`](/commands/server-tools/stickymessage/#stickymessage-add) (`,sticky`) is gated on
  **Server Premium**, every subcommand included, and needs **Manage Server** on top. Self Premium
  doesn't open it. See [Premium tiers](/docs/getting-started/premium-tiers/).
</Callout>

## Stick a message to a channel [#stick-a-message-to-a-channel]

[`,stickymessage add`](/commands/server-tools/stickymessage/#stickymessage-add) posts a preview back
to you and the real copy into the channel. Use a channel mention: a bare word matches the first
channel with that fragment in its name.

<CommandBlock syntax=",stickymessage add <channel> <code>" example=",stickymessage add #support {color: #fb4868}$p{title: Before you ask}$p{description: Say what you tried and paste the error. A screenshot of the whole window beats a crop.}" />

<EmbedPreview code="{color: #fb4868}$p{title: Before you ask}$p{description: Say what you tried and paste the error. A screenshot of the whole window beats a crop.}" caption="The sticky as it sits at the bottom of the channel." />

* **One sticky per channel.** Running `add` again replaces the code but doesn't clean up the copy
  already there.
* **`add` posts first, then saves.** If the bot can't post, nothing is saved, so a confirmation means
  it's live.
* **`{user}` is whoever tipped the counter,** not you, so `{user.mention}` pings someone new on every
  re-post.
* **A sticky can be plain text, buttons or Components V2.** A code that renders nothing is refused.
* **A colored button can carry a [private reply](/docs/features/embed-codes/#answer-a-button-with-a-private-reply).** It keeps working on every re-post, and it is filled in for whoever presses it.

<CommandBlock syntax=",stickymessage add <channel> <code>" example=",stickymessage add #support {title: Before you ask}$p{button: blue && Checklist && reply: {description: Say what you tried and paste the error.}}" />

<EmbedPreview surface="message" code="{title: Before you ask}$p{button: blue && Checklist && reply: {description: Say what you tried and paste the error.}}" caption="A sticky with a Checklist button. Press it and only the person who pressed sees the reply." />

* **On slash,** `/stickymessage add` asks for the channel, then opens a pop-up for the code (up to
  4,000 characters; submit within ten minutes).

## Choose how often it re-posts [#choose-how-often-it-re-posts]

[`,stickymessage limit`](/commands/server-tools/stickymessage/#stickymessage-limit) sets how many
messages pass before it moves back to the bottom. The channel must already have a sticky.

<CommandBlock syntax=",stickymessage limit <channel> <number>" example=",stickymessage limit #support 15" />

| Part       | Accepts                               | Default |
| ---------- | ------------------------------------- | ------- |
| `<number>` | a whole number, 1 to 100, digits only | `10`    |

At `1` the sticky re-posts after every message and walls off the conversation. At `100` in a quiet
channel it's buried for days.

## Delete each re-post [#delete-each-re-post]

Add `++delete <seconds>` (1 to 600, digits, at the very end of the code) to remove each re-post after
a delay. The first copy from `add` is never on a timer, so the channel is mostly empty between
re-posts. That is almost never what you want.

## What moves the message [#what-moves-the-message]

When the count reaches your limit, the bot sends the new copy, then deletes the old one, so a failed
re-post leaves the old one in place.

* **Only people count.** Bots, webhooks and the sticky's own re-post never advance the counter.
* **The count resets** when the bot restarts.

<Callout type="warn" title="Bot chatter buries a sticky without moving it">
  Another bot's output pushes your sticky up the screen while the count barely moves. If it shares a
  channel with an [`,automessage`](/commands/server-tools/automessage/#automessage-add), a music
  panel or a logging feed, lower the limit or give the noisy feature its own channel.
</Callout>

If Server Premium lapses, re-posting stops on the next message. **Nothing is deleted**: every
channel, code and limit resumes when premium returns, and the last copy stays as an ordinary message.

## Read, list and remove stickies [#read-list-and-remove-stickies]

[`,stickymessage check`](/commands/server-tools/stickymessage/#stickymessage-check) prints one
channel's raw saved code. [`,stickymessage list`](/commands/server-tools/stickymessage/#stickymessage-list)
pages through every sticky with its limit.

<CommandBlock syntax=",stickymessage check <channel>" example=",stickymessage check #support" />

<CommandBlock syntax=",stickymessage list" />

[`remove`](/commands/server-tools/stickymessage/#stickymessage-remove) stops one channel's sticky;
[`reset`](/commands/server-tools/stickymessage/#stickymessage-reset) stops every one in the server.
Neither deletes the copy already posted.

<CommandBlock syntax=",stickymessage remove <channel>" example=",stickymessage remove #support" />

<CommandBlock syntax=",stickymessage reset" />

<Callout type="warn" title="`reset` has no short form and no confirmation">
  It wipes every sticky with no undo. `r`, `d` and `delete` all belong to `remove`. On slash they are
  two separate entries.
</Callout>

## Common issues [#common-issues]

**`Server Premium Only`.** The whole command is gated, `check` and `list` included.

**`I could not post in #channel ... Nothing was saved.`** The bot needs View Channel, Send Messages
and Embed Links there. Fix the overrides and run `add` again.

**Two copies are in the channel.** You ran `add` twice (only a re-post clears the old copy), or the bot
couldn't reach the old one. It needs View Channel and Read Message History. Delete the stray yourself
(Manage Messages).

**`Limit must be a whole number, like 3.`** Digits only: `1m` and `-5` are refused and the stored
limit is left alone. A trailing word is ignored: `,sticky limit #support 10 messages` sets 10.

**`There was never a sticky messages in that channel`.** `limit` only edits an existing sticky: run
`add` first.

**The sticky disappears seconds after it posts.** Your code ends in `++delete`. Run `check` to see it,
then re-`add` without the flag.
