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

CommandDescription
/leaderos-update-settingsIt fetches and updates the settings made through the dashboard.
/profileOnly users with linked accounts can use it. It displays profile information for the linked account, visible only to the user issuing the command.

Requirements

  • Node.js 16.11.0 or newer is required.
  • Git (for using git clone command) (optional)

Installation

  1. Create and configure an App on Discord Developer Portal. How can I create and configure an App on Discord Developer Portal?
  2. Configure LeaderOS Discord module on Dashboard. How can I configure LeaderOS Discord Module on Dashboard?
  3. 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?

  1. Go to Discord Developer Portal
  2. Create an Application by clicking the “New Application” button.
  3. Enter a name for your Discord Application.
  4. 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
    
  5. Go to Bot section and enable intents.
  6. 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.

FieldDescription
Client IDYour Discord Application OAuth Client ID Discord Developer > Application > OAuth > Client ID
Client SecretYour Discord Application OAuth Client Secret Discord Developer > Application > OAuth > Client Secret
Bot TokenYour Discord Application Bot Token Discord Developer > Application > Bot > Token
Server IDYour Discord Server ID (Guild ID)
Everyone Role IDEveryone Role ID on your Discord Server
Synced Role IDWhen 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 SyncingAfter 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 NicknameAfter 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 TicketsThe Support Tickets feature enables you to respond to support tickets on your website directly from your Discord server
Ticket Discord Category IDEnter 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 IDEnter the Discord Role ID for staff members who should be able to view/reply support tickets on your Discord server
Ticket Embed Message TemplateEnter 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?

  1. Install Node.js
  2. Install Git
  3. Clone the repository: git clone https://github.com/leaderos-net/leaderos-discord-bot
  4. Go to the bot directory: cd leaderos-discord-bot
  5. Install the dependencies: npm install
  6. Rename the .env.example file to .env and configure it.
  7. 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?

KeyDescription
DISCORD_BOT_TOKENYour bot’s token. You can find it in the Discord Developer Portal > Applications > Your Application > Bot
WEBSITE_URLYour website’s URL. (Example: https://yourdomain.com)
API_KEYYour Website API key. You can find it in the Dashboard > Settings > API
LANGUAGEThe language of the bot. You can find the list of languages in the languages folder.
DEBUGEnable or disable debug mode.
ROLE_SYNC_CACHE_PERIODRole Sync Cache Period in seconds.