Fallen Bot is a feature-rich Discord bot built with Discord.js and TypeScript. It provides a wide range of commands for moderation, music playback, server management, and fun interactions.
- Fallen Bot - Discord Bot
Fallen Bot offers a comprehensive set of features designed to enhance Discord server management and user experience:
- Robust Moderation System: Ban, kick, timeout, and warning management with permission hierarchy enforcement and action logging.
- Advanced Music Player: High-quality audio playback with playlist support, queue management, and various playback controls.
- Interactive Commands: Fun commands that generate rich embed responses and interactive elements.
- Role Management: Sophisticated role assignment system with permission validation.
- Server Information: Commands to display user, server, and asset information.
- Welcome System: Customizable welcome messages with rich embeds when new members join the server.
The bot is built with a modular architecture using TypeScript and Discord.js v14. Key technical features include:
- TypeScript Integration: Type-safe code with interfaces for commands, events, and configurations.
- Command Handler System: Dynamic command loading and execution with subcommand support.
- Event-Based Architecture: Event-driven design following Discord.js patterns.
- Error Handling: Comprehensive error catching and user-friendly error messages.
- Permission Management: Built-in permission validation for commands.
The moderation suite provides comprehensive tools for server administrators and moderators.
Removes a user from the server (they can rejoin with an invite).
- Options:
target: The user to kick (required)reason: Reason for the kick (optional)
- Permissions Required:
KICK_MEMBERS - Features:
- Validates moderator has higher role than target
- Creates detailed logs
- Returns confirmation with user information
Permanently removes a user from the server.
- Options:
target: The user to ban (required)reason: Reason for the ban (optional)delete_messages: How much message history to delete (optional, in days)
- Permissions Required:
BAN_MEMBERS - Features:
- Can ban users who aren't in the server
- Message deletion options (none, 24h, 3d, 7d)
- Detailed logging and confirmation
Removes a ban on a user, allowing them to rejoin with an invite.
- Options:
user_id: ID of the banned user (required)reason: Reason for the unban (optional)
- Permissions Required:
BAN_MEMBERS - Features:
- Validates the ID is for a currently banned user
- Logs the unban action
- Returns confirmation with user information
Temporarily restricts a user from sending messages or joining voice channels.
- Options:
target: The user to timeout (required)duration: Timeout duration (required, formats like "1h", "30m", "1d")reason: Reason for the timeout (optional)
- Permissions Required:
MODERATE_MEMBERS - Features:
- Flexible duration parsing (seconds, minutes, hours, days, weeks)
- Maximum duration enforcement (28 days)
- Detailed logging and confirmation
Removes an active timeout from a user.
- Options:
target: The user to remove timeout from (required)reason: Reason for removing the timeout (optional)
- Permissions Required:
MODERATE_MEMBERS - Features:
- Verifies user actually has an active timeout
- Logs the removal action
- Returns confirmation with user information
Issues a warning to a user that is recorded in the warning system.
- Options:
target: The user to warn (required)reason: Reason for the warning (required)
- Permissions Required:
MODERATE_MEMBERS - Features:
- In-memory warning storage system
- Attempts to notify user via DM
- Generates unique IDs for each warning
- Tracks warning count per user
Shows the warning history for a specified user.
- Options:
target: The user to check warnings for (required)
- Permissions Required:
MODERATE_MEMBERS - Features:
- Lists all warnings with IDs, timestamps, reasons, and moderator information
- Chronological ordering (newest first)
- User-friendly embed display
The welcome system provides customizable welcome messages for new members joining your server.
Enables the welcome system and sets the welcome channel.
- Options:
channel: The text channel to send welcome messages to (required)
- Permissions Required:
MANAGE_GUILD - Features:
- Activates welcome messages for new members
- Sets up default welcome message if not previously configured
- Validates that the selected channel is a text channel
Disables the welcome system.
- Permissions Required:
MANAGE_GUILD - Features:
- Turns off welcome messages while preserving your settings
Sets the welcome message text.
- Options:
text: Welcome message text (required)
- Permissions Required:
MANAGE_GUILD - Features:
- Supports variables:
{user},{username},{tag},{server},{memberCount} - Customizable message content
- Supports variables:
Customizes the welcome embed appearance.
- Options:
title: Embed title (optional)color: Embed color as hex code (optional)footer: Footer text (optional)image: URL of an image to include in the embed (optional)
- Permissions Required:
MANAGE_GUILD - Features:
- Color validation for proper hex format
- Custom image support
- Personalized title and footer text
Configures rules information in welcome messages.
- Options:
show: Whether to show rules info in welcome messages (required)channel: Rules channel to reference (required if show is true)
- Permissions Required:
MANAGE_GUILD - Features:
- Adds a convenient link to your rules channel
- Can be toggled on/off as needed
Configures whether to mention new users in welcome messages.
- Options:
enabled: Whether to mention new users (required)
- Permissions Required:
MANAGE_GUILD - Features:
- Allows controlling whether users get pinged with welcome message
Previews the welcome message.
- Permissions Required:
MANAGE_GUILD - Features:
- Shows exactly how the welcome message will appear
- Uses your current settings
- Marks the preview so it's not confused with a real welcome
Checks welcome system status and configuration.
- Permissions Required:
MANAGE_GUILD - Features:
- Comprehensive overview of all welcome settings
- Shows enabled/disabled status
- Displays all configuration options in one view
Tests the welcome system by simulating a member join.
- Options:
target: User to simulate joining (optional, defaults to command user)
- Permissions Required:
MANAGE_GUILD - Features:
- Sends a real welcome message to the configured channel
- Helps verify welcome message appearance
- Can test with different users in your server
The music system allows for high-quality audio playback from YouTube/YouTube Music with extensive controls.
Plays a song or playlist from YouTube/YouTube Music.
- Options:
query: Song name or URL (required)
- Features:
- Auto-joins voice channel
- Supports direct URLs and search terms
- Playlist support with automatic loading
- High-quality audio playback
Shows the current song queue with pagination.
- Options:
page: Queue page number (optional)
- Features:
- Paginated display for large queues
- Shows current track progress
- Displays queue statistics and duration
Basic playback control commands.
- Subcommands:
pause: Pauses the current trackresume: Resumes playbackskip: Skips to the next trackstop: Stops playback and clears the queue
- Features:
- Detailed embeds showing the affected track
- State validation (e.g., can't pause when already paused)
Adjusts playback volume.
- Options:
percentage: Volume level 1-100 (required)
- Features:
- Real-time volume adjustment
- Shows volume change information
Jumps to a specific position in the current track.
- Options:
timestamp: Time to seek to (required, formats like "1:30" or "90")
- Features:
- Multiple timestamp format support
- Validation against track duration
- Shows new position information
Sets the loop mode for playback.
- Options:
mode: Loop mode (required, choices: off/track/queue)
- Features:
- Track loop: Repeats the current song
- Queue loop: Repeats the entire queue
- Detailed status display
Shows information about the currently playing track.
- Features:
- Visual progress bar
- Track metadata (duration, requester, etc.)
- Thumbnail and URL
Randomizes the order of tracks in the queue.
- Features:
- Preserves the currently playing track
- Shows preview of upcoming tracks after shuffle
Removes all tracks from the queue except the currently playing track.
- Features:
- Queue size validation
- Confirmation message with count of removed tracks
Shows available commands and usage information.
- Options:
category: Command category to show details for (optional)
- Features:
- Categorized command listing
- Detailed usage examples
- Command syntax explanation
Checks the bot's latency.
- Features:
- Displays message latency
- Shows API latency
- Real-time calculation
Displays information about a user.
- Options:
target: User to get info about (optional, defaults to command user)
- Features:
- Shows account creation date
- Displays server join date
- Lists roles and other user information
Shows information about the current server.
- Features:
- Member count statistics
- Server creation date
- Boost level and count
- Server owner information
Adds or removes roles from users.
- Subcommands:
add: Adds a role to a userremove: Removes a role from a user
- Options:
target: User to modify roles for (required)role: Role to add/remove (required)
- Permissions Required:
MANAGE_ROLES - Features:
- Role hierarchy enforcement
- Permission validation
- Confirmation messages
Shows a user's avatar in high resolution.
- Options:
target: User to show avatar for (optional, defaults to command user)
- Features:
- High-resolution image display
- Direct link to avatar image
Displays the server's icon in high resolution.
- Features:
- High-resolution image display
- Validation for servers without icons
Flips a virtual coin.
- Options:
times: Number of coins to flip (optional, default 1)
- Features:
- Multiple coin flips support (up to 100)
- Statistical breakdown for multiple flips
- Visually appealing embed
Rolls virtual dice.
- Options:
sides: Number of sides on the dice (optional, default 6)count: Number of dice to roll (optional, default 1)sum: Whether to show the sum of all dice (optional)
- Features:
- Support for various dice types (d6, d20, etc.)
- Multiple dice rolls
- Statistical information for multiple rolls
- Critical success/fail notifications
Simulates a Magic 8-Ball with random responses to questions.
- Options:
question: Question to ask (required)
- Features:
- 20 different possible responses
- Color-coded responses (positive, neutral, negative)
- Visually appealing embed
Play Rock, Paper, Scissors with the bot.
- Options:
choice: Your selection (rock, paper, or scissors) (required)
- Features:
- Fair random selection by the bot
- Win/loss/tie tracking
- Visual representation of choices
Creates a poll for server members to vote on.
- Options:
question: The poll question (required)options: Poll options separated by commas (required)duration: How long the poll should last in minutes (optional)
- Features:
- Automatic reaction addition for voting
- Timed results calculation
- Support for up to 10 options
- Results display after completion
A humor command that generates a random "gay percentage" for a user.
- Options:
target: User to evaluate (optional, defaults to command user)
- Features:
- Random percentage generation
- Visual progress bar
- Rarity levels with different colors
- Purely for entertainment purposes
To set up the bot on your local machine:
-
Clone the repository:
git clone [repository-url] cd fallen-bot -
Install dependencies:
npm install
-
Create configuration files: Create a
.envfile in the root directory with the following variables:TOKEN=your_discord_bot_token CLIENT_ID=your_client_id GUILD_ID=your_development_guild_id -
Build the TypeScript code:
npm run build
-
Deploy the commands (for development):
npm run deploy
-
Start the bot:
npm start
The bot uses environment variables for configuration. Required variables:
TOKEN: Your Discord bot token from the Discord Developer PortalCLIENT_ID: Your bot's client IDGUILD_ID: The ID of your development server
You can verify your environment setup with:
npm run verify-envFor production deployment:
-
Build the project:
npm run build
-
Set up production environment variables
-
Start the bot:
npm start
For continuous operation, consider using a process manager like PM2:
npm install -g pm2
pm2 start dist/index.js --name fallen-botPlanned features for future development:
- Database Integration: Replace in-memory storage with a persistent database
- Web Dashboard: Admin interface for bot configuration
- Custom Prefix: Allow servers to set custom command prefixes
- Auto-moderation: Content filtering and automated moderation actions
- Leveling System: User experience points and levels
- Reaction Roles: Role assignment via reactions
- Scheduled Events: Recurring announcements and events
- Localization: Support for multiple languages