Integrations
Discord Bot
Allow players to link their accounts and roles, login with Discord account, and reply support tickets on your Discord server. It’s completely Open Source!
Features
- Role Sync: Syncs the roles of your users with your Discord server and changes the username on Discord to match the in-game username.
- Support Tickets: You can manage support tickets through Discord with your staff team. A user who has linked their account can view and respond to their support tickets on Discord.
- Discord Login: Users who have linked their accounts can log in to their matched accounts using their Discord credentials instead of a username and password on the website.
Commands
Command | Description |
---|---|
/leaderos-update-settings | It fetches and updates the settings made through the dashboard. |
/profile | Only users with linked accounts can use it. It displays profile information for the linked account, visible only to the user issuing the command. |
Requirements
Installation
- Create and configure an App on Discord Developer Portal. How can I create and configure an App on Discord Developer Portal?
- Configure LeaderOS Discord module on Dashboard. How can I configure LeaderOS Discord Module on Dashboard?
- Setup and run the Bot on your server. How can install and run LeaderOS Discord bot?
How can I create and configure an App on Discord Developer Portal?
- Go to Discord Developer Portal
- Create an Application by clicking the “New Application” button.
- Enter a name for your Discord Application.
- Go to OAuth2 section. Then Add redirect links by clicking the “Add Redirect” button.
Add these links. Please replace “yourwebsite.com” with your actual website address.
https://yourwebsite.com/discord/login https://yourwebsite.com/discord/link https://yourwebsite.com/discord/unlink
- Go to Bot section and enable intents.
- Invite the bot to your Discord server with Administrator permission. You can use this tool to invite the bot.
How can I configure LeaderOS Discord Module on Dashboard?
Go to Dashboard > Modules and enable Discord Bot module. Then go to Dashboard > Settings > Discord Bot and enter your Discord Application credentials.
Field | Description |
---|---|
Client ID | Your Discord Application OAuth Client ID Discord Developer > Application > OAuth > Client ID |
Client Secret | Your Discord Application OAuth Client Secret Discord Developer > Application > OAuth > Client Secret |
Bot Token | Your Discord Application Bot Token Discord Developer > Application > Bot > Token |
Server ID | Your Discord Server ID (Guild ID) |
Everyone Role ID | Everyone Role ID on your Discord Server |
Synced Role ID | When the Discord account linking is successful, users are assigned a role called “Synced” to trigger the event. Create a role named “Synced” in your Discord server and copy its ID. |
Role Syncing | After linking discord account, role syncing matches user’s website roles with their roles on the Discord server. You can enable or disable Role Syncing system. |
Set Nickname | After linking accounts, Set Nickname changes the user’s Discord server name to match their in-game username. You can enable or disable nickname setter. |
Server Tickets | The Support Tickets feature enables you to respond to support tickets on your website directly from your Discord server |
Ticket Discord Category ID | Enter the ID of the category under which support tickets will be created on the Discord server. This ID determines the category where the channels for support tickets will be placed |
Ticket Staff Role ID | Enter the Discord Role ID for staff members who should be able to view/reply support tickets on your Discord server |
Ticket Embed Message Template | Enter the content for the embed message that will be sent to the channel when a support ticket is opened. |
How to install and run LeaderOS Discord bot?
- Install Node.js
- Install Git
- Clone the repository:
git clone https://github.com/leaderos-net/leaderos-discord-bot
- Go to the bot directory:
cd leaderos-discord-bot
- Install the dependencies:
npm install
- Rename the .env.example file to .env and configure it.
- Run the bot.
npm run start
How to install LeaderOS Discord bot on Pterodactyl Panel?
1
Download the LeaderOS Discord Bot Egg
2
Create a New Nest
- Navigate to Pterodactyl Panel > Admin Control > Nests.
- Click on the “Create New” button to initiate the nest creation process.
- Name the new nest “LeaderOS.”
3
Import the Bot Egg
- In the Nests section, locate the newly created “LeaderOS” nest.
- Click on the “Import Egg” button.
- Select the LeaderOS Discord Bot Egg JSON file.
- Associate this egg with the “LeaderOS” nest.
4
Set Up a New Server for the Discord Bot
- Proceed to Pterodactyl Panel > Admin Control > Servers.
- Click on the “Create New” button to initiate server creation.
- Configure the necessary fields for the new server.
- Ensure to select the “LeaderOS” nest and the LeaderOS Discord Bot Egg.
5
Configure Service Variables
- Customize the service variables according to your requirements. How can I configure the .env file?
How can I configure the .env file?
Key | Description |
---|---|
DISCORD_BOT_TOKEN | Your bot’s token. You can find it in the Discord Developer Portal > Applications > Your Application > Bot |
WEBSITE_URL | Your website’s URL. (Example: https://yourdomain.com ) |
API_KEY | Your Website API key. You can find it in the Dashboard > Settings > API |
LANGUAGE | The language of the bot. You can find the list of languages in the languages folder. |
DEBUG | Enable or disable debug mode. |
ROLE_SYNC_CACHE_PERIOD | Role Sync Cache Period in seconds. |