Frosty-8 Discord Bot

A modular Discord bot with slash commands and web interface built with Discord.js v14

Discord.js Node.js Express Slash Commands

📝 Project Overview

Frosty-8 is a feature-rich Discord bot designed to provide utility and entertainment through slash commands. Built with a modular architecture, it's easy to extend with new commands and features.

Key Features

  • Modular slash command system organized by categories
  • Automatic command registration on startup
  • Built-in web server for health checks and uptime monitoring
  • Ready for deployment on Render with included configuration
  • 12 utility commands for various purposes
  • Clean, maintainable code structure

📁 Project Structure

frosty-8-discord-bot/ ├── README.md ├── deploy-commands.js ├── index.js ├── package.json ├── render.yaml └── commands/ └── utility/ ├── 8ball.js ├── define.js ├── dice.js ├── greet.js ├── motivate.js ├── ping.js ├── predict.js ├── remindme.js ├── roast.js ├── server.js └── user.js

⚙️ Available Commands

/8ball
Ask the magic 8-ball a yes/no question
/define
Get simple word definitions
/dice
Roll a 6-sided dice
/greet
Greets the server user
/motivate
Receive a motivational quote
/ping
Check bot response time
/predict
Receive a mysterious prediction
/remindme
Set a short reminder
/roast
Gently roast a friend
/server
Display server information
/user
Display your user info

🚀 Setup Instructions

1. Clone the Repository

git clone https://github.com/yourusername/discord-bot.git
cd discord-bot

2. Install Dependencies

npm install

3. Configure Environment Variables

Create a .env file with the following content:

TOKEN=your_discord_bot_token
CLIENTID=your_discord_application_client_id
GUILDID=your_test_server_id
PORT=3000

4. Run the Bot

node index.js

🌐 Deployment to Render

The project includes a render.yaml configuration file for easy deployment to Render:

services:
  - type: web
    name: discord-bot
    env: node
    plan: free
    buildCommand: npm install
    startCommand: node index.js
    autoDeploy: true
    envVars:
      - key: TOKEN
        sync: false
      - key: CLIENTID
        sync: false
      - key: GUILDID
        sync: false

Deployment Steps

  1. Push your code to a GitHub repository
  2. Create a new Web Service on Render.com
  3. Link your GitHub repository
  4. Add the required environment variables (TOKEN, CLIENTID, GUILDID)
  5. Render will automatically build and deploy your bot

🧩 Example Command Code

Here's an example of a command module (8ball.js):

// 8ball.js
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('8ball')
        .setDescription('Ask the magic 8-ball a yes/no question')
        .addStringOption(option =>
            option.setName('question')
                .setDescription('Your yes/no question')
                .setRequired(true)),
    async execute(interaction) {
        const responses = [
            'Yes', 'No', 'Definitely', 'Absolutely not', 'Ask again later',
            'It is certain', 'I have my doubts', 'Not in a million years', 'You bet!', 'No chance'
        ];
        const question = interaction.options.getString('question');
        const reply = responses[Math.floor(Math.random() * responses.length)];
        await interaction.reply(`🎱 **Question:** ${question}\n**Answer:** ${reply}`);
    },
};

🛠️ Technology Stack

Node.js Node.js
JavaScript JavaScript
Discord.js Discord.js v14
Express Express
Render Render

📜 License

This project is licensed under the ISC License.

© 2025 - Created with ❤️ for learning and fun Discord automation.