Back to documentation

Discord bot

The Flitt bot connects your game servers to your Discord: live status, chat relay, player notifications, account verification, role sync, RCON and moderation. Every feature is free on every plan.

🤖

1. Install the bot

Three steps from the panel, no configuration file to edit.

  1. 1.Open Dashboard → Discord Bot and click « Invite the bot ». You must be owner or administrator of the Discord.
  2. 2.Back on Flitt, the Discord appears in the list: open it and link one or more of your servers from the Servers tab.
  3. 3.Enable what you want per server: status embed, chat relay, notifications, logs relay, RCON, role sync. The addon picks the change up within 10 minutes (or restart it).
⌨️

2. Commands

Players and admins get slash commands in Discord:

/link

Get a code to link your game account

/verify

Check the link and receive the verified role

/profile

Linked accounts, playtime and sessions

/status /players /servers

Live status and online players

/leaderboard /vote /links

Top players, votes, quick links

/rcon

Run a console command (role configured in the panel)

/warn /kick /ban /timeout /clear /cases

Moderation, mirrored in game for linked players

🔗

3. Account linking

Linking is code based, so it works the same on Garry's Mod, FiveM and Minecraft, no Steam login needed:

  1. 1.The player runs /link in Discord and receives a 6-character code (valid 10 minutes).
  2. 2.In game they type: !flitt CODE (chat) on Garry's Mod and FiveM, /flitt CODE on FiveM, /flitt link CODE on Minecraft.
  3. 3.The link is stored once per game; verification, role sync and moderation mirroring use it.
🔧

4. Role sync · Garry's Mod

ULX, SAM and the native usergroups are detected automatically. If you use another admin system, answer these hooks from any server-side file (return true from the setters to tell Flitt you handled it):

-- Read the player's rank (string)
hook.Add("FLT_DiscordGetGroup", "MyAdmin", function(ply)
    return MyAdmin.GetRank(ply)
end)

-- Apply a rank change coming from Discord
hook.Add("FLT_DiscordSetGroup", "MyAdmin", function(steamId64, group, add, ply)
    MyAdmin.SetRank(steamId64, add and group or "user")
    return true
end)

-- Optional: bans issued from Discord
hook.Add("FLT_DiscordBan", "MyAdmin", function(steamId64, minutes, reason, ply)
    MyAdmin.Ban(steamId64, minutes, reason)
    return true
end)

In the panel, map each Discord role to the in-game group name your system uses (e.g. superadmin, moderator, vip).

🚓

5. Role sync · FiveM

By default Flitt reads ace groups (group.admin, group.mod…) and writes them with add_principal / remove_principal. Set the list with set flitt_discord_groups "owner,admin,mod,vip" in server.cfg. For ESX/QBCore jobs, vRP or a custom admin menu, handle these events from any resource:

-- Read the player's rank (call reply with a string)
AddEventHandler("flitt:discord:getGroup", function(source, identifier, reply)
    reply(MyAdmin.GetRank(identifier))
end)

-- Apply a rank change coming from Discord (call done(true) when handled)
AddEventHandler("flitt:discord:setGroup", function(identifier, group, add, done)
    MyAdmin.SetRank(identifier, add and group or "user")
    done(true)
end)

-- Optional: bans issued from Discord
AddEventHandler("flitt:discord:ban", function(identifier, seconds, reason, done)
    MyAdmin.Ban(identifier, seconds, reason)
    done(true)
end)

identifier is the player's license (or steam/discord identifier when license is missing), the same value Flitt shows in the player list.

⛏️

6. Role sync · Minecraft

LuckPerms is detected automatically (primary group read, parent add/remove written). Without LuckPerms, a player belongs to group X when they hold the permission flitt.group.X, and changes go through console commands you define in plugins/Flitt/config.properties:

# Groups Flitt looks for, first match wins
discord.groups=owner,admin,mod,helper,vip

# Commands run when Discord adds / removes a group
# Placeholders: {name} {uuid} {group}
discord.group-add-command=pex user {name} group add {group}
discord.group-remove-command=pex user {name} group remove {group}

# Optional: command for bans issued from Discord
# Placeholders: {name} {uuid} {reason} {minutes}
discord.ban-command=tempban {name} {minutes}m {reason}

Plugin developers can also register their own provider: plugin.getDiscordManager().setGroupProvider(new MyProvider()) — implement fr.flitt.common.discord.GroupProvider (getGroup / setGroup).

💡

Loops are handled for you

A change pushed from Discord is not echoed back as a game event (and vice versa), so two-way sync never ping-pongs. Every /rcon and moderation action is logged in the guild's case log and in the server audit log.