In this article, we will explore the structure and purpose of a JSON file used for configuring a Discord bot. The JSON file contains important settings and parameters that need to be customized to ensure the bot functions correctly. We will specifically discuss four key elements: "token," "licenseKey," super users array, and the connection string. Let's dive in!
Token
The "token" field in the JSON file is where you should add your Discord bot token. This token acts as a unique identifier for your bot and grants it permission to connect to and interact with Discord servers. To obtain a token for your bot, you'll need to create a new bot application on the Discord Developer Portal (https://discord.com/developers/applications). Once you have the token, simply replace the placeholder text in the JSON file with your actual token.
License Key
The "licenseKey" field in the JSON file refers to the license key obtained from the bot panel, specifically bots.relyhost.io. This key is essential for authenticating and authorizing your bot to use certain features or access specific resources. To acquire the license key, navigate to the bot panel and locate the license key associated with your bot. Copy the key and paste it into the "licenseKey" field in the JSON file.
Super Users Array
The "super users" field in the JSON file allows you to specify a list of user IDs that have special privileges or administrative access to the bot. To add your super users, create an array of user IDs within the brackets. For example: [646907767466229762, 313106868736229398]
. Replace these example IDs with the actual user IDs of the individuals you want to grant super user status. Super users typically have elevated permissions and can perform certain privileged actions within the bot.
Connection String
The "connection string" field in the JSON file is used to establish a connection between the bot and a MySQL database. The provided connection string format is an example and should be modified to match your specific database configuration. Replace the placeholders in the following format:
Server=SERVER_HOST;Database=DATABASE_NAME;User=USER;Password=PASS;
Ensure you have a valid MySQL server address, database name, username, and password. This connection is crucial if your bot requires persistent data storage or interacts with a database.