> For the complete documentation index, see [llms.txt](https://mythicalbot.gitbook.io/arklynn-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mythicalbot.gitbook.io/arklynn-docs/resources/scripting/levelup-message.md).

# Levelup Message

### Known Issues

{% hint style="danger" %}
**{rank} – does not resolve (shows raw text)**

**{xp\_next} – does not resolve (shows raw text)**
{% endhint %}

### Basic Command

Run this command in the channel where level‑up messages should appear:

```
;setup_levelup_message #channel {embed}$v{color: #a855f7}$v{description: **{user.name}** → Level {level}}$v{thumbnail: {user.avatar}}
```

### How It Works

1. You run `;setup_levelup_message` with your embed template in the desired channel.
2. The bot saves that template.
3. Whenever a member gains enough XP to reach a new level, the bot automatically sends the saved template in that channel, replacing variables with real data.

To update the level‑up message, simply run `;setup_levelup_message` again with a new embed.

***

### Available Variables for Level‑Up Messages

| **Variable**     | **Description**                                                        |
| ---------------- | ---------------------------------------------------------------------- |
| `{user.name}`    | Name of the member who levelled up                                     |
| `{user.avatar}`  | Avatar URL of the member                                               |
| `{user.mention}` | Mention of the member (pings them)                                     |
| `{level}`        | The new level the member just reached                                  |
| `{xp}`           | Total XP the member currently has                                      |
| `{rank}`         | <mark style="color:$danger;">**Global rank of the member**</mark>      |
| `{xp_next}`      | <mark style="color:$danger;">**XP required for the next level**</mark> |
| `{guild.name}`   | Name of your server                                                    |
| `{timestamp}`    | Current time (automatically formatted)                                 |

{% hint style="info" %}
`{rank}` and `{xp_next}` are planned variables but **do not work at the moment**. If you use them, they will appear as raw text like `{rank}`. Use the other variables for now.
{% endhint %}

***

### Examples

Below are the four example templates you provided – each can be used as a single `;setup_levelup_message` command.\
\&#xNAN;*(Remember: only one embed per command – choose the style you like best.)*

#### 1. Simple Purple Embed

```
;setup_levelup_message {embed}$v{color: #a855f7}$v{description: **{user.name}** → Level {level}}$v{thumbnail: {user.avatar}}
```

#### 2. Orange Celebration with Button

```
;setup_levelup_message {embed}$v{color: #f97316}$v{title: 🥳 LEVEL UP!}$v{description: {user.mention} is now **Level {level}** – keep going!}$v{image: {user.avatar}}$v{field: Total XP && {xp} XP && inline}$v{field: Rank && #{rank} && inline}$v{button: link && 🎉 Celebrate! && https://giphy.com/embed/l0HlNQ3J6j7Mq1D9m}
```

{% hint style="warning" %}
&#x20;`{rank}` will show as `{rank}` – replace with a static message or remove until fixed.
{% endhint %}

#### 3. Green Detailed Embed with Next Level Info

```
;setup_levelup_message {embed}$v{color: #22c55e}$v{title: ⬆️ Level Up!}$v{description: Congratulations {user.mention}! You advanced to **Level {level}**}$v{thumbnail: {user.avatar}}$v{field: XP && {xp} XP && inline}$v{field: Global Rank && #{rank} && inline}$v{field: Next Level && {xp_next} XP needed}$v{timestamp}
```

{% hint style="warning" %}
`{rank}` and `{xp_next}` will appear as raw text – consider omitting these fields until they work.
{% endhint %}

#### 4. Short Purple Mention Embed

```
;setup_levelup_message {embed}$v{color: #8e7ef8}$v{description: **{user.mention}** just reached **Level {level}**! 🎉}$v{thumbnail: {user.avatar}}$v{timestamp}
```

***

### Tips & Best Practices

* **Use bright, happy colours** – violet (`#a855f7`), orange (`#f97316`), green (`#22c55e`), or soft purple (`#8e7ef8`).
* **Mention the user** – `{user.mention}` works and will ping them, making the announcement more personal.
* **Avoid broken variables** – until `{rank}` and `{xp_next}` are fixed, use only `{level}`, `{xp}`, `{user.name}`, `{user.avatar}`, `{user.mention}`, and `{timestamp}`.
* **Add a button** – link to a celebration GIF or your server’s level leaderboard.
* **Line breaks** – use `\n` inside `description` or field values.

***

### Interactive Builder (Recommended)

Design your level‑up embed visually at:\
[**arklynn.xyz/embed**](https://arklynn.xyz/embed)

After designing, copy the generated command and **replace `;ann #channel` with `;setup_levelup_message`** before sending.

***

### Troubleshooting

| Issue                                      | Solution                                                                                                                                                    |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{rank}` or `{xp_next}` appear as raw text | These variables are **not yet implemented**. Remove them from your template or wait for a bot update.                                                       |
| No level‑up message appears                | Make sure you ran `;setup_levelup_message` at least once in that channel. Also verify the bot has `Send Messages` and `Embed Links` permissions.            |
| Variables like `{level}` show as raw text  | This is normal when running `;setup_levelup_message` – the command stores the *template*. Variables are replaced automatically when a real level‑up occurs. |
| Button doesn’t show                        | Ensure the URL starts with `https://` or `http://`.                                                                                                         |

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mythicalbot.gitbook.io/arklynn-docs/resources/scripting/levelup-message.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
