# Tags

Source: https://righteousbot.dev/docs/features/tags/

Save a named snippet of text and let anyone in the server call it back by name.

A tag is a piece of text with a name. Someone types `,tag rules` and the bot posts what you saved under
`rules`. An [autoresponder](/docs/features/autoresponder/) fires on its own; a tag only answers when
asked. Tags are prefix-only (no slash form), and the aliases `,t` and `,tags` work.

Anyone can call a tag. Making, changing or inspecting one needs **Manage Messages**.

## Call a tag [#call-a-tag]

<CommandBlock syntax=",tag <name>" example=",tag rules" />

[`,tag`](/commands/fun/tag/) is not case-sensitive, so `,tag RULES` works. An unknown name is answered
with "No tag found with that name".

## Save a tag [#save-a-tag]

[`,tag add`](/commands/fun/tag/#tag-add) (alias `create`) takes the name, then the text. The name is
**one word**, so `,tag add server rules here` makes a tag called `server` with the body `rules here`.
Join a longer name up (`serverrules`). An existing name is refused rather than overwritten. The body
can be up to **2,000 characters**, the most one Discord message holds.

<CommandBlock syntax=",tag add <name> <content>" example=",tag add rules Read #rules before posting." />

<Callout type="error" title="A tag is plain text">
  [Embed codes](/docs/features/embed-codes/) and variables are not read: `{title: Rules}` and `{user}`
  post exactly as typed. Mentions render but never ping, so a tag can't alert a role.
</Callout>

## Change a tag [#change-a-tag]

| Command                                                                       | Does                                        |
| ----------------------------------------------------------------------------- | ------------------------------------------- |
| [`,tag edit <name> <content>`](/commands/fun/tag/#tag-edit) (alias `e`)       | Replaces the whole body; there is no append |
| [`,tag rename <name> <new name>`](/commands/fun/tag/#tag-rename) (alias `re`) | Changes the name, keeps the body            |
| [`,tag remove <name>`](/commands/fun/tag/#tag-remove) (alias `delete`)        | Deletes it. No confirmation, no undo        |

`rename` refuses a new name another tag already has. A change shows up on the next `,tag <name>` straight
away.

## See what the server has [#see-what-the-server-has]

| Command                                                           | Shows                                                       |
| ----------------------------------------------------------------- | ----------------------------------------------------------- |
| [`,tag list`](/commands/fun/tag/#tag-list)                        | Every tag, ten to a page, with its creator (not the bodies) |
| [`,tag search <word>`](/commands/fun/tag/#tag-search) (alias `s`) | Tags whose **name** contains the word                       |
| [`,tag info <name>`](/commands/fun/tag/#tag-info) (alias `i`)     | The full body and the creator                               |
| [`,tag author <name>`](/commands/fun/tag/#tag-author)             | Just the creator                                            |

A tag outlives its creator: if they've left the server, `list`, `info`, `search` and `author` show their
user ID marked "(left the server)".

## Don't name a tag after a subcommand [#dont-name-a-tag-after-a-subcommand]

`,tag <word>` checks subcommands first, so a tag named `add`, `create`, `edit`, `e`, `remove`, `delete`,
`rename`, `re`, `info`, `i`, `search`, `s`, `author`, `list` or `help` saves fine but its name runs the
subcommand instead. Pick another name. Because tags are a command,
[`,command disable`](/commands/server-tools/command/#command-disable) and role or channel restrictions
apply to them.

## Common issues [#common-issues]

**`,tag something` says "No tag found with that name".** There's no such tag. Names are one word, so a tag
added as `server rules` is really called `server`. Check `,tag list`.

**I made a tag and it won't come back.** Its name is on the reserved list above. Rename it.

**Only the first word of my tag name saved.** The first word is the name and the rest is the body.
Remove it and add it again with the name joined up.

**My tag prints `{user}` instead of a name.** Tags don't run variables. For text that changes per person,
use an [autoresponder](/docs/features/autoresponder/).

**A long tag ends in "… \[clipped]".** It was saved before the 2,000-character limit, so it's longer than one
message can show. `,tag info` shows more of it; `,tag edit` it down to fit.
