Skip to content

Installation & Setup

The installation steps, the configuration and how to create your own Discord bot.

  1. Download the ZIP package
  2. Extract to a local folder
  3. Set FTP transfer mode to binary
  4. Upload files to your server’s resources folder
  5. Add to server.cfg
  6. Restart your server

Add the resource to your server.cfg somewhere ON TOP as one of the first starting resources:

ensure night_discordapi

Configure /config/config.lua (see configuration section below).

Note: This resource requires a Discord bot to function. You must create your own Discord bot application. How to do this is covered in the next step.

Config = {
-- Discord Bot Token
Discord_Bot_Token = "",
-- Discord Guild/Server Configuration
Discord_Guild_Names = {
["YOUR_GUILD_ID"] = "Your Guild Name",
["ANOTHER_GUILD_ID"] = "Another Guild Name",
},
-- Discord Role Mapping
Discord_Role_Names = {
["ROLE_ID"] = "Role_Name",
["ANOTHER_ROLE_ID"] = "Another_Role",
},
-- Logging Level (0 = INFO/ERROR/WARN only, 1+ = includes DEBUG)
Discord_API_Log_Level = 1,
}
  • Discord_Bot_Token: Your Discord bot token
  • Discord_Guild_Names: Map Discord server IDs to readable names
  • Discord_Role_Names: Map Discord role IDs to custom role names
  • Discord_API_Log_Level: Control logging verbosity

You must provide your own Discord bot token. Follow the tutorial above to create your bot and obtain the token:

Discord_Bot_Token = "YOUR_BOT_TOKEN_HERE"

📺 How to Create a Discord Bot - Quick Tutorial

  1. Go to Discord Developer Portal
  2. Click “New Application”
  3. Enter a name for your application (e.g., “My FiveM Server Bot”)
  4. Click “Create”
  1. In your application’s settings, select the “Bot” tab
  2. Click “Add Bot” and confirm by clicking “Yes, do it!”
  3. Customize your bot’s username and profile picture as desired
  1. Under the “Bot” tab, click the “Reset Token” button to generate a new token
  2. Copy the token and store it securely - this token is essential for your bot’s functionality
  1. Navigate to the “OAuth2” tab in your application’s settings
  2. Under “Scopes”, select “bot”
  3. In the “Bot Permissions” section, choose the permissions your bot requires:
    • Read Messages/View Channels
    • Any other functionalities to obtain member (role) information
  4. Copy the generated URL
  1. Paste the copied URL into your browser
  2. Select the server you want to add the bot to and click “Authorize”
  3. Complete any CAPTCHA verification if prompted