# Setting up Discord Rich Presence for a FiveM server

> Show your server on every player’s Discord profile: create a Discord application, upload 1024×1024 art, and set SetDiscordAppId, SetDiscordRichPresenceAsset, SetRichPresence and the two action buttons from a client script.

Source: https://fam-tools.com/guides/fivem-discord-rich-presence · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 11 min

**Short answer.** Create an application in the Discord developer portal, upload your art (1024×1024), then in a client script call `SetDiscordAppId` with the application ID, `SetDiscordRichPresenceAsset` with the art’s key, `SetRichPresence` with a status line, and optionally `SetDiscordRichPresenceAction` for up to two buttons.

## Key points

- Rich Presence needs a **Discord application**; its ID goes into `SetDiscordAppId`.
- Art is uploaded to the application and referenced by its **key name**, not a URL.
- Upload art at **1024×1024**, as Discord recommends.
- Up to **two buttons** with `SetDiscordRichPresenceAction` (index 0 and 1).
- Update the status line on a slow timer — every few seconds is plenty.

Every player on your server shows up in their friends’ Discord sidebar as “Playing FiveM”. With Rich Presence you replace that with your server’s logo, name, a live status line and up to two buttons — one of which can take their friends straight to your Discord. It is one small client script and a Discord application, and it is one of the cheapest growth tools a server has.

## What players and their friends see

| Element | Set with | Typical content |
| --- | --- | --- |
| Application name | The Discord application itself | Your server name, e.g. “My City RP” |
| Large image | `SetDiscordRichPresenceAsset` | Your logo or a city shot |
| Large image hover text | `SetDiscordRichPresenceAssetText` | “mycity.gg” |
| Small image | `SetDiscordRichPresenceAssetSmall` | A job or rank badge |
| Status line | `SetRichPresence` | “Patrolling as LSPD · 84/128 online” |
| Buttons (max 2) | `SetDiscordRichPresenceAction` | “Join Discord”, “Connect” |

## Create the Discord application

Open the Discord developer portal, create a new application and name it after your server — that name is what appears as “Playing …”.

1. Create the application and copy its **Application ID** from General Information.
2. Open the Rich Presence art assets section and upload your images.
3. Give each image a short lowercase key such as `logo` or `police` — you reference the key in code.
4. Upload at 1024×1024; Discord strongly recommends that size for Rich Presence art.

> **New art takes a while** — Newly uploaded assets can take several minutes to become available. If an image does not show right away, wait before assuming the key is wrong.

## The client script

Create a small resource with a client script. The natives are client-side and only need to be set once, except the status line, which you refresh as things change.

*client.lua*

```lua
local APP_ID = '123456789012345678' -- your Application ID

CreateThread(function()
    SetDiscordAppId(APP_ID)

    SetDiscordRichPresenceAsset('logo')
    SetDiscordRichPresenceAssetText('mycity.gg')

    SetDiscordRichPresenceAssetSmall('badge')
    SetDiscordRichPresenceAssetSmallText('Serious RP')

    SetDiscordRichPresenceAction(0, 'Join our Discord', 'https://discord.gg/yourinvite')
    SetDiscordRichPresenceAction(1, 'Website', 'https://mycity.gg')

    while true do
        local players = #GetActivePlayers()
        SetRichPresence(('In the city · %d nearby'):format(players))
        Wait(15000)
    end
end)
```

*fxmanifest.lua*

```lua
fx_version 'cerulean'
game 'gta5'

client_script 'client.lua'
```

`GetActivePlayers()` on the client only returns players your client currently knows about (those in scope), not the server total. For the real online count, send it from the server — for example in a state bag or with a periodic event.

## Buttons: rules and good uses

- You get **two** buttons: index `0` and index `1`.
- Each button needs a label and an `https://` URL.
- Your own client never shows the buttons — they appear for other people viewing your profile. Test with a second account or ask a friend.
- The best pair: your Discord invite and a website or `cfx.re/join/` connect link.

A direct connect link lets friends join with one click. How the cfx.re join link works is covered in [server connect links](https://fam-tools.com/guides/fivem-server-connect-link-cfx-re).

## A status line people want to click

The status line is what makes Rich Presence feel alive. Keep it short (it truncates on narrow profiles) and make it about what the player is doing:

- “On duty · LSPD” — read the job from your framework.
- “Driving in Vinewood” — read the zone with `GetNameOfZone` and a label table.
- “In the queue” — while loading, before the character spawns.

> **Do not update it every frame** — Calling `SetRichPresence` inside a `Wait(0)` loop wastes client time for no visible benefit. Update on a timer of several seconds, or only when the job or zone actually changes.

## Troubleshooting

| Symptom | Fix |
| --- | --- |
| Still says “Playing FiveM” | Check the Application ID is correct and the resource started; the Discord desktop app must be running. |
| Image missing | The key must match the uploaded asset name exactly; new uploads can take minutes. |
| Buttons missing | Your own profile never shows them — check from another account. URLs must be https. |
| Status never changes | The loop is not running or errors earlier — check the F8 console. |

## Questions

### How do I show my server name on Discord in FiveM?

Create a Discord application named after your server and call `SetDiscordAppId` with its ID from a client script. The application name replaces “FiveM” in the player’s status.

### What size should Rich Presence images be?

Discord strongly recommends 1024×1024. Upload them to your application in the developer portal and reference them by key.

### How many buttons can Rich Presence have?

Two, set with `SetDiscordRichPresenceAction` using index 0 and 1.

### Why can I not see my own buttons?

Discord hides Rich Presence buttons on your own profile. Other people see them.

### Can I use an image URL instead of an uploaded asset?

The classic FiveM natives take the asset key uploaded to your application. Uploading the art to the application is the reliable method.

### Does Rich Presence work if the player does not have Discord open?

No. The Discord desktop client must be running on the player’s PC for FiveM to update their presence.

## Related

- https://fam-tools.com/guides/fivem-discord-server-branding-sizes
- https://fam-tools.com/guides/fivem-image-sizes-assets-guide
- https://fam-tools.com/guides/grow-fivem-server-players
- https://fam-tools.com/guides/fivem-server-connect-link-cfx-re
