Skip to content

YoussefSelk/Discord-Bot-GRAY-One-Tap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎮 GRAY One Tap — Discord Bot

A Discord.js bot that provides a temporary voice channel system for your server. Users can join a dedicated voice channel to automatically create their own private room, with full control over it (kick, reject, set limits, claim ownership, etc.).


🚀 Features

  • Temporary Voice Rooms: Automatically creates a personal voice channel when a user joins "Join to Create Temp Room"
  • Room Ownership: Each temp room has an owner who can manage it
  • Reject / Unreject Users: Room owners can reject (ban) or unreject (unban) users from their room
  • Claim Room: Claim ownership of an abandoned temp room when the original owner disconnects
  • Set Room Limits: Set max/min member limits for your temporary room
  • Server Stats: View server statistics with a clean embed
  • Dev Setup Command: One command to set up the entire temp room system (category + channels)
  • Custom Embed System: Rich, color-coded embeds for all bot responses (success, error, warning, info, moderation, welcome, goodbye, etc.)
  • Automatic Command Handling: Commands are automatically loaded and deployed
  • Event Handler: Events are automatically loaded from the events/ directory
  • Owner/Developer Permission System: Restrict commands to devs or server owners
  • Hot Reload: Development mode with nodemon

📁 Project Structure

src/
├── commands/
│   ├── dev/
│   │   └── create.js              # /create — Sets up the temp room system
│   └── misc/
│       ├── claim.js               # /claim — Claim an abandoned temp room
│       ├── ping.js                # /ping — Bot latency check
│       ├── reject.js              # /reject — Reject (ban) a user from your room
│       ├── unreject.js            # /unreject — Allow a rejected user back
│       ├── setlimit.js            # /setlimit — Set max/min members for your room
│       └── serverStats.js         # /server-stats — Server information embed
├── config/
│   └── client.config.js           # Loads DISCORD_TOKEN & CLIENT_ID from .env
├── events/
│   ├── interactionCreate/
│   │   └── handleCommands.js      # Slash command router
│   ├── ready/
│   │   ├── 01deployCommands.js    # Auto-deploy slash commands on startup
│   │   └── consolLog.js           # Log bot online status
│   └── voiceStateUpdate/          # Handles temp room creation/deletion
├── handlers/
│   └── eventHandler.js            # Dynamically loads all events
├── utils/
│   ├── areCommandsDifferent.js    # Detects command changes for re-deploy
│   ├── client.js                  # Discord.js client with intents
│   ├── embeds.js                  # EmbedUtils class (success, error, warning, info, help, welcome, goodbye, moderation, serverInfo, userInfo, custom)
│   ├── getAllFiles.js             # Recursive file/folder reader
│   ├── getApplicationCommands.js  # Fetches registered slash commands
│   ├── getLocalCommands.js        # Loads local command files
│   ├── getRoomOwner.js            # Gets the owner of a temp room
│   └── isTempRoom.js             # Checks if a channel is a temp room
└── index.js                       # Entry point

🛠️ Installation

Prerequisites

Setup

  1. Clone the repository

    git clone https://github.com/YoussefSelk/Discord-Bot-GRAY-One-Tap.git
    cd Discord-Bot-GRAY-One-Tap
  2. Install dependencies

    npm install
  3. Create a .env file (see .env.example)

    DISCORD_TOKEN=your_discord_bot_token_here
    DISCORD_CLIENT_ID=your_discord_client_id_here
  4. Update config.json

    {
      "devs": ["your_discord_user_id"],
      "owners": ["your_discord_user_id"]
    }
  5. Invite the bot to your server with the following OAuth2 scopes:

    • bot
    • applications.commands

    Required bot permissions:

    • Manage Channels
    • Connect / Move Members
    • View Channels
    • Send Messages / Embed Links

🚀 Usage

Development Mode

npm run dev

Production Mode

npm start

Setting Up Temp Rooms

Once the bot is online, use the /create command (dev-only) in your server. This will automatically create:

  • A GRAY One Tap category
  • A #gray-tempvc-info text channel (read-only for members, bot posts logs here)
  • A Join to Create Temp Room voice channel

When a user joins the voice channel, a personal temp room is created. When all users leave, it is automatically deleted.


🎮 Commands

Command Description Access
/create Sets up the temp room system (category + channels) Devs only
/claim Claims ownership of an abandoned temp room Everyone
/reject <user> Rejects (bans) a user from your temp room Room owner
/unreject <user> Allows a rejected user back into your room Room owner
/setlimit <max> [min] Sets max (2-99) and optional min member limits Room owner
/server-stats Shows server statistics Everyone
/ping Shows bot latency Owners only

🎨 Embed System

The bot uses a custom EmbedUtils class (src/utils/embeds.js) providing styled embeds:

Method Color Usage
EmbedUtils.success() 🟢 Green Successful actions
EmbedUtils.error() 🔴 Red Errors
EmbedUtils.warning() 🟡 Yellow Warnings
EmbedUtils.info() 🔵 Blue Information
EmbedUtils.help() 🟣 Purple Command help
EmbedUtils.welcome() 🟢 Green Welcome messages
EmbedUtils.goodbye() 🔴 Red Goodbye messages
EmbedUtils.moderation() 🟠 Orange Moderation actions
EmbedUtils.serverInfo() 🔵 Blue Server stats
EmbedUtils.userInfo() 🔵 Blue User info
EmbedUtils.custom() Any Fully custom embed

📝 Creating New Commands

Add a file in src/commands/<category>/:

module.exports = {
  name: "commandname",
  description: "Command description",
  deleted: false,
  devsOnly: false,
  ownersOnly: false,
  options: [
    {
      name: "user",
      description: "Target user",
      type: 6, // User
      required: true,
    },
  ],
  callback: async (client, interaction) => {
    // Command logic
    interaction.reply("Done!");
  },
};

Commands are automatically loaded and deployed on startup.


⚙️ Configuration

Environment Variables (.env)

Variable Description
DISCORD_TOKEN Your Discord bot token
DISCORD_CLIENT_ID Your Discord application client ID

config.json

Key Description
devs Array of user IDs with developer access
owners Array of user IDs with owner access

📦 Dependencies

  • discord.js — Discord API wrapper
  • dotenv — Environment variable management
  • nodemon — Auto-restart in development

🔧 Available Scripts

Script Description
npm run dev Start in development mode (nodemon)
npm start Start in production mode

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the ISC License.


🆘 Support


Made with ❤️ by YoussefSelk

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors