Supra is a Discord bot built with Discord.js that offers slash commands, event-driven features, and a highly customizable setup. π Perfect for enhancing your Discord server with interactivity and functionality! π
- π§ Slash Command Support: Simplified, interactive commands for your users.
- π Automatic Command Registration: Dynamically loads and registers commands from the
commandsfolder. - π
Event-Driven Architecture: Efficiently handles Discord events like
readyandinteractionCreate. - π οΈ Customizable Bot Status: Configure the botβs activity and status directly via the
.envfile. - π Interactive Help Command: Provides a clean, categorized list of commands or details about specific ones.
- π‘οΈ Error-Resilient Design: Logs errors to ensure uninterrupted bot functionality.
Here's how the bot is organized:
π root/
βββ π commands/ # π¬ All bot commands are stored here
β βββ avatar.js # πΌοΈ Displays a user's avatar
β βββ ban.js # π« Bans a user from the server
β βββ clear.js # π§Ή Clears chat messages
β βββ help.js # β Displays command information
β βββ meme.js # π Shows a random meme
β βββ ping.js # πΆ Tests bot latency
β βββ poll.js # π³οΈ Creates a poll
β βββ reload.js # π Reloads the bot's commands
β βββ server-info.js # π Displays server information
β βββ unban.js # π Unbans a user by ID
β βββ user.js # π€ Shows user details
βββ π events/ # π All bot event listeners are stored here
β βββ ready.js # β
Triggered when the bot is online
β βββ interactionCreate.js # β‘ Handles slash command interactions
βββ .env # π Configuration file for environment variables
βββ .gitignore # π« Specifies files to ignore in version control
βββ index.js # π Main entry point for the bot
βββ package.json # π¦ Project metadata and dependencies
Before running the bot, make sure you have the following:
- π₯οΈ Node.js v16.9.0 or later
π₯ Download Node.js - π Discord.js v14+
π Discord.js Guide - π Discord Bot Token
π Generate a Bot Token
Follow these steps to set up and run Supra:
-
Clone the Repository:
git clone https://github.com/Slaayyz/Supra cd Supra -
Install Dependencies:
npm install
-
Set Up the
.envFile:
Create a.envfile in the root directory with the following variables:TOKEN=your-bot-token CLIENT_ID=your-bot-client-id OWNER_ID=your-id ACTIVITY=Playing Supra Bot STATUS=online # Options: online, idle, dnd- If
ACTIVITYandSTATUSare left empty, the bot will have no custom activity.
- If
-
Start the Bot:
node index.js
-
Add the Bot to Your Server:
Use the following URL (replaceCLIENT_IDwith your bot's client ID):https://discord.com/api/oauth2/authorize?client_id=CLIENT_ID&permissions=8&scope=bot%20applications.commands
Hereβs a list of all implemented commands:
| π Command | π Description |
|---|---|
/avatar |
πΌοΈ Displays a userβs avatar. |
/ban |
π« Bans a member from the server. |
/clear |
π§Ή Deletes a specified number of messages. |
/help |
β Provides a list of commands or details. |
/meme |
π Displays a random meme. |
/ping |
πΆ Checks bot and Discord API latency. |
/poll |
π³οΈ Creates a poll with multiple options. |
/reload |
π Restarts the bot (Admin only). |
/server-info |
π Displays server information. |
/unban |
π Unbans a user by their ID. |
/user |
π€ Displays information about a selected user. |
- β Invalid Commands: Responds gracefully with an error message.
- π οΈ Misconfigured Files: Logs errors to the console for debugging without crashing the bot.
- β‘ Resilient Operation: Ensures the bot continues to operate smoothly despite errors.
π Updating Slash commands...
β
Slash commands updated successfully.
β
Logged in as Supra#1234
-
Create a new
.jsfile in thecommandsfolder. -
Use this template for your new command:
const { SlashCommandBuilder } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('your_command_name') .setDescription('Your command description.'), category: 'Your Category', // E.g., 'Utility', 'Fun', etc. async execute(interaction) { await interaction.reply('Your command response!'); }, };
-
Restart the bot, and your command will be automatically registered. π
This project is open-source and licensed under the MIT License. π
You are free to use, modify, and distribute the software under the terms of the license.
For more information, refer to the LICENSE file.
π Enjoy customizing and using Supra!