> For the complete documentation index, see [llms.txt](https://fragmentdevelopment.gitbook.io/fivem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fragmentdevelopment.gitbook.io/fivem/paid-scripts/api.md). Agents can also search and read this documentation through its [MCP server](https://fragmentdevelopment.gitbook.io/fivem/~gitbook/mcp).

# DISCORD API

This is a script that allows you (and others) to perform actions on your FiveM server from Discord commands.

Preview: Coming soon...

***

## Compatibility

* ESX
* QBCore
* QBOX

***

## Settings Preview

```lua
local Settings = {}

Settings.AutoSql = true                                        -- Automatically create the database tables if they don't exist. If you disable this, you need to create the tables manually if they don't exist already.
Settings.TxAdminAuthor = GetConvar("sv_projectName", "System") -- Author of the txAdmin resource. This is used for the global announcement.

--[[
    'auto' means it will automatically detect your Anticheat.

    Available options:
    - auto
    - custom
    - disabled
    - ElectronAC
    - FiveGuard
    - WaveShield
    You can also defined the options above manually as the value.
]]
Settings.Anticheat = "auto"
Settings.FiveGuardName = "FiveGuard" -- Name of the FiveGuard resource. If you don't use FiveGuard you can ignore this.

--[[
    'auto' means it will automatically detect your Framework.

    Available options:
    - auto
    - custom
    - ESX
    - QBCore
    - QBOX
    You can also defined the options above manually as the value.
]]
Settings.Framework = 'auto'

--[[
    'auto' means it will find your framework' language convar in your server.cfg, if it's not specified there, 'en' will be used.

    Compatible auto framework' language detection:
    - ESX: esx:locale
    - QBCore: qb_locale
    - QBOX: qb_locale

    Available options:
    - 'en' (English)
    - 'es' (Spanish)
    You can your own language in the locales/ directory.
]]
Settings.Language = 'auto'

--[[
    'auto' means it will automatically detect your clothing script.

    Compatible auto clothing script detection:
    - illenium-appearance
    - rcore_clothing

    Available options:
    - 'auto'
    - 'ilenium-appearance'
    - 'rcore_clothing'
    - 'custom' (You can set your own clothing functions in server/server.lua)
]]
Settings.Clothing = 'auto'

Settings.Requests = {
    authorization = "", -- Authorization key for the requests

    content_type = "application/json",
    method = "POST",

    acceptedIps = {
        ["127.0.0.1"] = true, -- Only allow requests from the local machine
    }
}

Settings.Bans = {
    Use = {
        hardware = true,
        license = true,
        license2 = true,
        discord = true,
        live = true,
        fivem = true,
        ip = true,
        steam = true,
        xbl = true
    }
}

Settings.ShowAuthorizationKeyOnLogs = false -- Show the authorization key on the logs. This is useful for debugging, but you should disable it in production.
Settings.Webhooks = {
    requests = "",
    actions = "",
    bans = "",
    unban = "",
    kicks = "",
    licence_change = "",

    -- Webhook for the Anticheat images such as screenshots or screen recordings.
    ac_images = "",
}

return Settings
```
