# Discord application

Create the Discord application, upload your logo and add buttons.

## Create the application

1. Open the [Discord Developer Portal](https://discord.com/developers/applications) and click **New Application**.
2. Choose the name carefully. Discord shows it as "Playing **…**" on every player's profile, so use your server name.
3. Under **General Information**, copy the **Application ID**.
4. Paste it into `config.lua`:

```lua config.lua
Config.Discord = {
    AppId = '123456789012345678',
```

While `AppId` is still `'000000000000000000'`, the F8 console shows `Config.Discord.AppId is not set, Rich Presence will not show`.

## Upload your logo

Your logo is shown in character selection, as the small image while playing, and as the large image whenever a character photo is not available yet.

1. In your application, open **Rich Presence → Art Assets**.
2. Click **Add Image(s)** and upload your logo as a PNG or JPG of at least **512×512** pixels.
3. Name it, for example `logo`, and click **Save Changes**.
4. Use the exact same name in `config.lua`:

```lua config.lua
LargeImage = { FallbackAsset = 'logo' },
SmallImage = { Asset = 'logo', Text = '{server_name}', HideWhenLargeIsFallback = true },
```

> **Asset names are case sensitive.** `Logo`, `logo` and `LOGO` are three different assets. If the name does not match exactly, Discord shows no image.
>
> New assets can take **10 to 15 minutes** to appear. This is normal Discord caching.

Character photos do not need to be uploaded here. They are loaded straight from your [image host](#/docs/wd_richpresence/image-hosting).

`HideWhenLargeIsFallback` hides the small image while the large image already shows your logo, so the logo does not appear twice.

## Add buttons

Up to two buttons appear on each player's profile:

```lua config.lua
Buttons = {
    { label = 'Join Server', url = 'https://cfx.re/join/abc123' },
    { label = 'Discord', url = 'https://discord.gg/yourinvite' },
},
```

- Find your join link on your server's page at [servers.fivem.net](https://servers.fivem.net). It looks like `https://cfx.re/join/abc123`.
- URLs must start with `https://`. Discord does not accept `fivem://` links, and the resource skips them.
- Labels are cut to 32 characters. [Placeholders](#/docs/wd_richpresence/presence) work in labels.
- Remove a line to show only one button, or leave the list empty for none.

**You never see your own buttons.** Discord only shows them to other people viewing your profile.

## Next step

Connect an [image host](#/docs/wd_richpresence/image-hosting) so each character's photo can be shown.
