# Connect

Post a pinned Discord panel with the city's status, players online, connect address and link buttons, refreshed every minute.

Source: https://fivedash.fivex.gg/docs/en/discord/connect

**Connect** is the sign at the city's entrance: a pinned message in a Discord channel that shows whether the server is online, how many people are playing and the address to type in F8. The bot updates the panel on its own every minute. This page is for the owner and the staff who run the server's Discord.

## Before you start

* **Plan:** the Discord module must be in the organization's plan (Plus, Pro and Ultra all include it).
* **Bot connected:** the city's bot must be connected to the Discord server. See [Bot](https://fivedash.fivex.gg/docs/en/discord/bot).
* **Server address in FiveDash:** the status and players come from the server's **Address (optional)** field in FiveDash ("A cfx.re/join link or IP:port, for the status, the players and Connect"). With a `cfx.re/join` link, the panel also gets the join-the-city button.
* **Access level** on the **Connect** area:

| Level         | What it allows                                              |
| ------------- | ----------------------------------------------------------- |
| **View**      | Panel and status                                            |
| **Configure** | Address, buttons and panel (save, publish, move and remove) |

## What shows on Discord

The panel is an embed with:

* the **Title** and **Text** (default: the server's name and "Come play in the city!");
* the **Status** block, with a dot (🟢 online, 🔴 offline, 🟡 maintenance) and the status text;
* the **Players** block (e.g. `48/128`), only with **Show players** on and the server online;
* the **Connect** block, with `connect` followed by the **Connect address**;
* link buttons below, five per row.

The bot checks the server every minute. Before showing offline, it tries again a moment later, so a hiccup doesn't turn the panel "Offline". The panel is only edited when something changes (or always, with **Time of the last check** on).

## Publish the panel

### Open the page

In the dashboard, go to **Discord → Connect**.

### Pick the channel

Under **Panel → Channel**, pick the **Panel channel**.

### Write the address

Under **Server → Connect address**, write what players type in F8. It can be an IP, a domain or the cfx.re link (e.g. `play.examplecity.com`). If you paste "connect play…", the "connect" part is removed on its own.

### Add buttons (optional)

Under **Buttons**, turn on **Join the city button** and click **Add a link (store, rules, Instagram…)** for links. Drag to reorder.

### Turn it on and save

Turn on the switch at the top (**On**) and click **Save**. The bot posts the panel and shows **Panel published**: "In #channel. It updates itself every minute."

Once published:

* saving again reposts the panel with the new look and deletes the old one, so it doesn't show "(edited)";
* changing the channel and saving moves the panel (**Panel moved**: the old message is deleted);
* turning the switch off and saving removes the panel (**Panel removed**) and the checks stop;
* the **Open in Discord** button takes you straight to the message;
* if someone deletes the panel by hand on Discord, the bot posts it again.

## Maintenance mode

Turn on **Server → Maintenance mode** and save. The panel shows "Under maintenance" right away, in yellow, whatever the server answers. Turn it off and save when the city is back: the bot checks the server before updating the panel.

## Settings

### Panel

| Field                           | What it does                                            | Default |
| ------------------------------- | ------------------------------------------------------- | ------- |
| **Channel** (**Panel channel**) | Where the pinned message lives. Required to turn it on. | None    |

### Server

| Field                | What it does                                                                        | Limit | Default |
| -------------------- | ----------------------------------------------------------------------------------- | ----- | ------- |
| **Connect address**  | What players type in F8 to join. IP, domain or cfx.re link. Required to turn it on. | 120   | Empty   |
| **Show players**     | How many are playing now and the maximum, while it's online.                        | —     | On      |
| **Maintenance mode** | Shows "Under maintenance" on the panel as soon as you save.                         | —     | Off     |

### Buttons

| Field                                     | What it does                                                                                                                                  | Limit   | Default                        |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------ |
| **Join the city button**                  | A button that opens FiveM straight into the city (`cfx.re/join/code`). Only for servers with a cfx.re code.                                   | —       | On                             |
| **Button text** (in **Edit join button**) | Needs text or an emoji.                                                                                                                       | 80      | "Join the city" (English city) |
| Emoji (in **Edit join button**)           | An icon from the bot's pack, a regular emoji or a server emoji.                                                                               | —       | The pack's connect icon        |
| Links                                     | Buttons that open a link (store, rules, Instagram…). Each has **Text** (up to 80), an optional emoji and a **Link** starting with `https://`. | 5 links | None                           |

## Messages

In the right column, **Messages** (**Text, status and images**) opens **Customize messages**, with two parts. Use **Restore default** to go back to the original texts in the city's language.

### Text and images

| Field         | What it does                                                              | Limit | Default (English city)   |
| ------------- | ------------------------------------------------------------------------- | ----- | ------------------------ |
| **Title**     | The panel's title line.                                                   | 120   | `{servidor}`             |
| **Text**      | Text under the title. The panel needs a title or some text.               | 1000  | "Come play in the city!" |
| **Image**     | Optional. Wide (2:1), GIFs up to 3 MB.                                    | —     | None                     |
| **Thumbnail** | Square, GIFs up to 1 MB: **Server icon**, **Your own image** or **None**. | —     | **Server icon**          |

PNG, JPG or WebP images go up to 1 MB.

### Status

| Field                                      | What it does                                                         | Limit | Default (English city) |
| ------------------------------------------ | -------------------------------------------------------------------- | ----- | ---------------------- |
| **Block titles** → **Status**              | The line above the status block. The status icon changes on its own. | 40    | "Status"               |
| **Block titles** → **Players**             | The line above the players block.                                    | 40    | "Players"              |
| **Block titles** → **Connect**             | The line above the connect block.                                    | 40    | "Connect"              |
| **Text for each status** → **Online**      | Goes inside the code block, next to the dot.                         | 60    | "Online"               |
| **Text for each status** → **Offline**     | Same.                                                                | 60    | "Offline"              |
| **Text for each status** → **Maintenance** | Same.                                                                | 60    | "Under maintenance"    |

Status texts sit in a code block: they don't show formatting or pack emojis. All three are required.

### Variables

The names stay in Portuguese in every language.

| Variable      | Becomes                                   |
| ------------- | ----------------------------------------- |
| `{servidor}`  | The FiveM server's name                   |
| `{jogadores}` | How many are playing now (— when offline) |
| `{vagas}`     | The server's player limit                 |

## Embed

**Embed** opens **Customize embed**.

| Field                      | What it does                                                                  | Default                                |
| -------------------------- | ----------------------------------------------------------------------------- | -------------------------------------- |
| **Color by status**        | Green online, red offline and yellow under maintenance.                       | On                                     |
| **Color**                  | The panel's side bar, when **Color by status** is off.                        | Bot color                              |
| **Server header**          | The Discord server's name and icon at the top.                                | Off                                    |
| **Time of the last check** | In the footer, so everyone sees the status is fresh.                          | On                                     |
| **Footer**                 | Short text (up to 100 characters), with an optional icon from the bot's pack. | "Updated automatically" (English city) |

## Preview

The preview next to the form shows the panel as it looks on Discord. Under **View as**, switch between **Online**, **Offline** and **Maintenance** to check each status. This only changes the preview.

## Notices on the page

| Notice                                                  | What it means                                      |
| ------------------------------------------------------- | -------------------------------------------------- |
| "The service that updates the panel is down…"           | The status stays frozen until the service is back. |
| "The bot can't send or edit messages in that channel…"  | Check the bot's permissions in the channel.        |
| "That channel no longer exists. Pick another one."      | The channel was deleted on Discord.                |
| "Discord asked us to wait…" / "Discord didn't respond…" | The panel updates on the next check.               |

## FAQ

**The panel shows Offline, but the city is up.**
The status comes from the **Address (optional)** saved on the FiveDash server, not from the panel's **Connect address**. Check that address.

**The Join the city button doesn't show.**
It only exists for servers with a cfx.re code. Save the `cfx.re/join/…` link as the server's address in FiveDash.

**How is this different from the /ip command?**
`/ip` answers right away, in the channel where it was used, with the server address saved in FiveDash. Connect is a pinned message that updates itself. See [Commands](https://fivedash.fivex.gg/docs/en/discord/commands).

## Next steps

[Commands](https://fivedash.fivex.gg/docs/en/discord/commands)

Every slash command of the bot, like /status and /ip.

[Welcome](https://fivedash.fivex.gg/docs/en/discord/welcome)

Greet people who join the Discord.

[Server](https://fivedash.fivex.gg/docs/en/server/overview)

The city's status, console and players.

[Bot](https://fivedash.fivex.gg/docs/en/discord/bot)

The color and emoji pack the panel uses.
