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
commands
folder. - 📅 Event-Driven Architecture: Efficiently handles Discord events like
ready
andinteractionCreate
. - 🛠️ Customizable Bot Status: Configure the bot’s activity and status directly via the
.env
file. - 📖 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
.env
File:
Create a.env
file 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
ACTIVITY
andSTATUS
are 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_ID
with 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
.js
file in thecommands
folder. -
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!