> For the complete documentation index, see [llms.txt](https://guardiandevlabs.gitbook.io/guardiandevlabs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guardiandevlabs.gitbook.io/guardiandevlabs/free-scripts/discord-ban-sync.md).

# Discord Ban Sync

This resource for FiveM ensures players are properly linked to your Discord server before they can join, checks for bans, and logs ban attempts. The script ensures a smooth integration between FiveM and Discord, offering a seamless experience for server administrators.

### Features

* **Discord Linking**: Players must link their Discord account to join the server.
* **Ban Sync**: Syncs bans from your Discord server with FiveM.
* **Server Invite**: Sends a Discord invite link to users who are not linked to Discord or need to join your server.
* **Ban Logging**: Logs ban attempts to a specified Discord channel.

***

<pre class="language-lua"><code class="lang-lua"><strong># Config.lua
</strong>
Config = {}

-- Your Discord Bot Token. This is required for accessing the Discord API.
Config.BotToken = 'your-bot-token-here'

-- The ID of your Discord Server (Guild). This is required for checking if users are in your server and checking bans.
Config.GuildID = 'your-guild-id-here'

-- The ID of the Discord channel where ban attempts will be logged.
Config.LogChannelID = 'your-log-channel-id-here'

-- The Discord invite URL for your server. Used when a player needs to join your Discord.
Config.DiscordInvite = 'https://discord.gg/your-invite-link-here'
</code></pre>

{% hint style="success" %}
Downloads\
\[Free] [Free Version](https://guardianlabs.tebex.io/package/6744696)\
\[Paid] [Open Source Version](https://guardianlabs.tebex.io/package/6747844)
{% endhint %}
