Docs /Discord Bot/Configuration
v1.0.0

Configuration — foltone_fivem_discord_bot

All configuration is done in the config.lua file at the root of the script.

Language

Config.Locale = "en" -- "fr" or "en"

Translations are in the locales/ folder. You can add your own languages by creating a new file (e.g., locales/de.lua).

Framework

Config.Framework = "auto" -- "auto", "esx", "qbcore" or "qbx"
ValueFrameworkDescription
"auto"Auto-detectionAutomatically detects ESX / QBCore / QBX at startup
"esx"ESX LegacyForces ESX usage
"qbcore"QBCoreForces QBCore usage
"qbx"QBXForces QBX usage

Debug Mode

Config.Debug = false

Set to true to enable detailed logs in the server console. Disable in production.

Bot

Config.Bot = {
    token = "YOUR_BOT_TOKEN",
    guildId = "YOUR_GUILD_ID",
    port = 3847,
    authToken = "RANDOM_SECRET",
    autoStart = true,
    healthCheckInterval = 60,
}
ParameterDescription
tokenDiscord bot token (obtained from the Developer Portal)
guildIdTarget Discord server ID
portInternal HTTP communication port between FiveM and the Node.js bot
authTokenShared secret key between FiveM and the bot (internal security)
autoStarttrue to start the bot automatically with the resource
healthCheckIntervalSeconds between each bot health check

Security: Never share your token or authToken. These values are in config.lua (open file), be careful with server access.

Permissions

Config.Permissions = {
    ["moderator"] = {
        roleIds = {"ROLE_ID"},
        commands = {
            "kick", "warn", "mute", "unmute", "freeze", "unfreeze",
            "playerlist", "playerinfo", "slap", "heal", "spectate"
        }
    },
    ["admin"] = {
        roleIds = {"ROLE_ID"},
        commands = {
            "ban", "unban", "tp", "revive", "setjob",
            "givemoney", "removemoney", "setmoney",
            "giveitem", "removeitem",
            "spawnvehicle", "deletevehicle",
            "sanctions", "announce", "weather", "time",
            "whitelist", "watchlist"
        }
    },
    ["founder"] = {
        roleIds = {"ROLE_ID"},
        commands = {"*"}    -- * = access to all commands
    }
}
ParameterDescription
Key (e.g., "moderator")Permission group name (custom)
roleIdsList of Discord role IDs with this access level
commandsList of allowed commands, or {"*"} to allow all

Available commands by category

CategoryCommands
Playersplayerlist, playerinfo, kick, ban, unban
Moderationwarn, mute, unmute, freeze, unfreeze, slap, heal, spectate
Economygivemoney, removemoney, setmoney, giveitem, removeitem
Vehiclesspawnvehicle, deletevehicle
Teleportationtp, revive
Jobsetjob
Serverannounce, weather, time, whitelist
Trackingsanctions, watchlist
Schedulingschedule
Infoserverstatus

Logs

Config.Logs = {
    enabled = true,
    mode = "split",
    channels = {
        single = "CHANNEL_ID",
        connection = "CHANNEL_ID",
        death = "CHANNEL_ID",
        transaction = "CHANNEL_ID",
        admin = "CHANNEL_ID",
        chat = "CHANNEL_ID",
    },
    transactionThreshold = 50000,
    maskIP = true,
    actionButtons = true,
}
ParameterDescription
enabledEnable/disable the logs system
mode"single" = one channel for all logs, "split" = one channel per type
channels.singleSingle channel ID (used if mode = "single")
channels.connectionChannel for player connections/disconnections
channels.deathChannel for player deaths
channels.transactionChannel for economy transactions
channels.adminChannel for admin actions
channels.chatChannel for in-game chat
transactionThresholdMinimum amount to log a transaction
maskIPtrue to hide player IPs in logs
actionButtonstrue to show quick action buttons on embeds

Dashboard

Config.Dashboard = {
    enabled = true,
    channelId = "CHANNEL_ID",
    refreshInterval = 30,
    showPlayerList = true,
    showAdminActions = true,
    showConnections = true,
    buttons = true,
}
ParameterDescription
enabledEnable/disable the dashboard
channelIdChannel ID where the dashboard is displayed
refreshIntervalSeconds between each automatic update
showPlayerListShow player list in the dashboard
showAdminActionsShow recent admin actions
showConnectionsShow recent connections
buttonsShow quick action buttons under the dashboard

The dashboard shows a real-time updated embed with server statistics.

Tickets

Config.Tickets = {
    enabled = true,
    categoryId = "CHANNEL_ID",
    logsChannelId = "CHANNEL_ID",
    maxOpenPerPlayer = 2,
    autoCloseAfter = 1440,
    transcriptEnabled = true,
    command = "ticket",
    keybind = "F6",
}
ParameterDescription
enabledEnable/disable the ticket system
categoryIdDiscord category ID where ticket channels are created
logsChannelIdLog channel ID for closed tickets
maxOpenPerPlayerMaximum open tickets per player simultaneously
autoCloseAfterMinutes before auto-closing an inactive ticket (1440 = 24h)
transcriptEnabledtrue to save transcripts of closed tickets
commandFiveM command to open a ticket from the game
keybindShortcut key to open a ticket from the game

Chat

Config.Chat = {
    enabled = true,
    channelId = "CHANNEL_ID",
    mode = "all",
    discordPrefix = "[DISCORD]",
    discordColor = {59, 130, 246},
    webhookName = "FiveM Chat",
    filterLinks = true,
    maxLength = 500,
}
ParameterDescription
enabledEnable/disable chat synchronization
channelIdDiscord channel ID linked to in-game chat
mode"all" = all messages, "discord_only" = Discord to game only, "game_only" = game to Discord only
discordPrefixPrefix shown in-game before Discord messages
discordColorRGB color for Discord messages in-game
webhookNameName shown on the Discord webhook
filterLinkstrue to block links in chat
maxLengthMaximum length of synchronized messages

Alerts

Config.Alerts = {
    enabled = true,
    channelId = "CHANNEL_ID",
    mentionRoleId = "ROLE_ID",
    cooldownPerPlayer = 30,
    cooldownGlobal = 10,
    rules = {
        warns = { enabled = true, count = 3, period = 1440 },
        transaction = { enabled = true, threshold = 500000 },
        playersLow = { enabled = true, threshold = 5 },
        playersHigh = { enabled = true, threshold = 60 },
        watchlist = { enabled = true },
        kills = { enabled = true, count = 5, period = 10 },
        crashDetect = { enabled = true, count = 10, period = 5 },
    }
}
ParameterDescription
enabledEnable/disable the alerts system
channelIdChannel ID where alerts are sent
mentionRoleIdRole ID mentioned in urgent alerts
cooldownPerPlayerSeconds between two alerts for the same player
cooldownGlobalSeconds between two global alerts

Alert rules

RuleParametersDescription
warnscount, periodAlert if a player receives X warnings in Y minutes
transactionthresholdAlert if a transaction exceeds the threshold
playersLowthresholdAlert if player count drops below threshold
playersHighthresholdAlert if player count exceeds threshold
watchlistAlert when a watched player connects
killscount, periodAlert if a player kills X players in Y minutes
crashDetectcount, periodAlert if X players disconnect in Y minutes

Scheduler

Config.Scheduler = {
    enabled = true,
    tasks = {
        {
            name = "daily_restart",
            type = "restart",
            cron = "0 4 * * *",
            countdownMinutes = {30, 15, 5, 1},
        },
    }
}
ParameterDescription
enabledEnable/disable the scheduler
tasksList of scheduled tasks
tasks[].nameUnique task name
tasks[].typeType: "restart" (server restart) or "announce" (announcement)
tasks[].cronCron expression for scheduling
tasks[].countdownMinutesMinutes before restart to send warnings

NUI Panel

Config.Panel = {
    enabled = true,
    command = "adminpanel",
    keybind = "F7",
    refreshInterval = 15,
    logsMaxDisplay = 100,
}
ParameterDescription
enabledEnable/disable the in-game admin NUI panel
commandCommand to open the panel
keybindShortcut key to open/close the panel
refreshIntervalSeconds between each automatic data refresh
logsMaxDisplayMaximum number of logs displayed in the panel logs tab

Database

Config.Database = {
    logRetentionDays = 30,
    purgeInterval = 1440,
}
ParameterDescription
logRetentionDaysNumber of days to retain logs before automatic deletion
purgeIntervalMinutes between each automatic database cleanup

Admin system

Config.AdminSystem = "auto"
ValueDescription
"auto"Automatic detection (ACE, vMenu, txAdmin, EasyAdmin)
"ace"Native FiveM ACE permissions (IsPlayerAceAllowed)
"vmenu"vMenu permission system
"txadmin"txAdmin permission system
"easyadmin"EasyAdmin permission system
"custom"Custom function in server/sv_editable.lua