A feature-rich Discord moderation bot with a cute pink aesthetic, built with Discord.js v14. Tomo provides comprehensive moderation tools, appeal systems, and administrative controls with a user-friendly interface.
- Ban/Unban: Advanced ban system with case tracking and appeal integration
- Kick System: User removal with hierarchy checks and case logging
- Warning System: Comprehensive warning management with automated escalation
- Channel Management: Lock/unlock channels with permission management
- Slowmode Control: Rate limiting with smart duration parsing
- Automod Integration: Automatic punishments based on warning thresholds
- Case Management: Automatic case ID generation and comprehensive logging
- Search & Discovery: Powerful log search with filtering and pagination
- Staff Notes: Private annotation system for user tracking
- User Information: Comprehensive user profiles with moderation history
- Moderation Statistics: Detailed stats for individual moderators and servers
- Case History: Complete moderation logs with searchable history
- Role Hierarchy: Respects Discord's role hierarchy for safety
- Discord Invite-Based Appeals: Users join a Discord server to submit appeals
- Customizable Ban Messages: Template system with variables for personalized ban notifications
- Appeal Integration: Ban messages include direct links to appeal servers when enabled
- System Toggles: Enable/disable appeals system server-wide
- Anti-Spam: Built-in prevention of duplicate and fraudulent appeals
- Permission System: Granular command permissions with whitelist/blacklist
- Staff Roles: Global staff role management
- Automod Rules: Configurable warning thresholds with automatic punishments
- Channel Settings: Configurable logs channels and appeal system
- Auto-Discovery: Automatic command registration and configuration
- Scalable Interface: Paginated command management for unlimited commands
- Cute Aesthetic: Pink theme with friendly messages and emojis
- Interactive UI: Discord buttons, select menus, and modals with seamless navigation
- Help System: Comprehensive help with action buttons
- Customizable Templates: Personalize ban messages with variables and custom styling
- Error Handling: Graceful error messages and recovery
- Node.js 16.11.0 or higher
- Discord Bot Token
- MongoDB (optional, uses JSON files by default)
-
Clone the repository
git clone https://github.com/yourusername/tomo-bot.git cd tomo-bot -
Install dependencies
npm install
-
Environment Setup Create a
.envfile in the root directory:DISCORD_TOKEN=your_bot_token_here
-
Start the bot
npm start
-
Initial Setup
- Invite the bot to your server with Administrator permissions
- Use
/configto set up staff roles and channels - Configure command permissions as needed
Bans a user from the server with optional message deletion.
Parameters:
user- The user to ban (required)reason- Reason for the ban (optional)delete_messages- Days of messages to delete (0-7, optional)
Features:
- Automatic case ID generation
- DM notification with custom ban template and appeal link
- Comprehensive permission checks
- Moderation logging
- Customizable ban message with variables
Unbans a previously banned user.
Parameters:
user- The user to unban (required)reason- Reason for the unban (optional)
Issues a warning to a user with automatic automod integration.
Parameters:
user- The user to warn (required)reason- Reason for the warning (optional)
Features:
- Automatic case ID generation
- DM notification to warned user
- Automod threshold checking
- Automatic punishment escalation (mute/kick/ban)
- Custom ban embed templates for automod bans
- Comprehensive permission and hierarchy checks
View all warnings for a specific user.
Parameters:
user- The user whose warnings to view (required)
Features:
- Complete warning history display
- Chronological ordering (newest first)
- Shows up to 10 most recent warnings
- Case details with moderator information
- Clean record celebration for users with no warnings
Delete a specific warning from a user's history using an interactive menu.
Parameters:
user- The user whose warning to delete (required)
Features:
- Interactive select menu showing all warnings
- Visual warning preview with dates and reasons
- Confirmation display with full warning details
- Supports up to 25 most recent warnings in menu
- Comprehensive deletion logging
Kicks a user from the server with case tracking.
Parameters:
user- The user to kick (required)reason- Reason for the kick (optional)
Features:
- Automatic case ID generation
- DM notification to kicked user
- Role hierarchy verification
- Moderation logging
- Permission checks
Locks a channel by removing Send Messages permission from @everyone.
Parameters:
channel- Channel to lock (optional, defaults to current channel)reason- Reason for locking (optional)
Features:
- Cute lock notification message
- Permission backup and restoration
- Staff-only access during lock
- Comprehensive logging
Unlocks a previously locked channel by restoring Send Messages permission.
Parameters:
channel- Channel to unlock (optional, defaults to current channel)reason- Reason for unlocking (optional)
Features:
- Cute unlock notification message
- Permission restoration
- Logging and case tracking
Sets slowmode (rate limit) for a channel.
Parameters:
duration- Slowmode duration (0s to disable, max 6h)channel- Channel to set slowmode (optional, defaults to current channel)reason- Reason for slowmode (optional)
Features:
- Human-readable duration formatting
- Smart duration parsing (5s, 1m, 2h, etc.)
- Automatic disable with 0 duration
- Visual confirmation with duration display
Search through moderation logs to find specific cases.
Parameters:
query- Search term (user, moderator, reason, or user ID)type- Filter by action type (warn, ban, kick, mute, etc.) (optional)limit- Number of results to show (1-20, default: 10) (optional)
Features:
- Multi-field search (usernames, moderators, reasons)
- Action type filtering
- Pagination for large result sets
- Case details with timestamps
- Useful for finding related incidents
Manage staff notes for users (staff-only visibility).
Subcommands:
add <user> <note>- Add a note to a userview <user>- View all notes for a userremove <user> <note_id>- Remove a specific note
Features:
- Staff-only visibility (ephemeral responses)
- Unique note IDs for easy management
- Timestamp tracking
- Moderator attribution
- Pagination for users with many notes
Get comprehensive information about a user (staff-only).
Parameters:
user- The user to get information about (required)
Features:
- Basic Info: Account age, creation date, bot status
- Server Info: Join date, roles, nickname, server tenure
- Current Status: Online status, timeouts, key permissions
- Moderation History: Case counts by type, most recent action
- Staff Notes: Recent notes with previews
- Account Safety: Handles users not in server
- Quick Access: Links to related commands for detailed views
View moderation statistics for yourself or another moderator.
Parameters:
moderator- Specific moderator to view (optional, defaults to yourself)
Shows:
- Actions by type (mutes, bans, kicks, warns)
- Time periods (7 days, 30 days, all time)
- Activity summary and trends
View case history for yourself or another user.
Parameters:
user- User whose history to view (optional, defaults to yourself)limit- Number of cases to show (1-20, default: 10)
Features:
- Complete case history with details
- Chronological ordering (newest first)
- Pagination for large histories
- Case summary statistics
Opens the main configuration interface with interactive buttons.
Sections:
- General: Basic bot settings and information
- Staff: Manage staff roles and permissions
- Commands: Configure command permissions and access (with search and pagination)
- Automod: Configure warning thresholds and automatic punishments
- Logs: Set up logging channels and customize ban templates
- Appeals: Configure Discord invite-based appeal system
Command Management Features:
- Search Functionality: Find commands quickly with search modal
- Pagination: Navigate through large command lists efficiently
- Interactive Management: Click-to-configure with visual status indicators
- Permission Control: Granular access control per command
Displays comprehensive help information with interactive navigation.
Features:
- Categorized command listing
- Interactive button navigation
- Support and refresh options
- Detailed command descriptions
Set yourself as away from keyboard with an optional reason.
Parameters:
reason- Why you're going AFK (optional)
-
Invite the Bot Generate an invite link with Administrator permissions:
https://discord.com/api/oauth2/authorize?client_id=YOUR_BOT_ID&permissions=8&scope=bot%20applications.commands -
Configure Staff Roles
/config β Staff β Add RoleSelect roles that should have moderation permissions.
-
Set Up Appeal System
/config β Logs β Set Appeal Server Invite /config β Logs β Customize Ban MessageConfigure Discord server invite for appeals and customize ban message template.
-
Configure Commands
/config β Commands β Manage CommandsSet permissions for individual commands.
-
Set Up Automod System
/config β Automod β Enable System /config β Automod β Add RuleConfigure automatic punishments based on warning thresholds.
Tomo uses a comprehensive permission system with multiple layers:
- Server Owner - Bypasses all restrictions (temporarily disabled)
- Global Staff Roles - Roles configured in
/config β Staff - Command Whitelist - Specific roles allowed for each command
- Public Commands - Commands marked as public access
- Blacklist Override - Users with blacklisted roles are always denied
- Whitelist Priority - Staff roles can use whitelisted commands
- Public Access - Some commands are available to everyone
- Default Deny - Unknown users/roles are denied by default
-
Enable Appeals System
/config β Logs β Enable Appeals -
Set Appeal Server Invite
/config β Logs β Set Appeal Server Invite -
Customize Ban Messages
/config β Logs β Customize Ban MessageCreate personalized ban notifications with variables like {user}, {server}, {reason}, {caseId}, {appealInvite}
-
Appeal Workflow
- User gets banned β Receives custom DM with appeal server invite
- User joins appeal server β Submits appeal through Discord
- Staff review appeals in the appeal server β Take appropriate action
-
Enable Automod System
/config β Automod β Enable System -
Add Warning Threshold Rules
/config β Automod β Add RuleConfigure automatic punishments:
- Threshold: Number of warnings to trigger (1-50)
- Action: Type of punishment (mute, kick, ban)
- Duration: For mutes only (1m, 1h, 1d, etc.)
-
Manage Existing Rules
/config β Automod β Manage RulesView, edit, or remove existing automod rules
-
Automod Features
- Automatic Escalation: Punishments trigger when warning thresholds are reached
- Custom Ban Templates: Automod bans use the same custom templates as manual bans
- Comprehensive Logging: All automod actions are logged with proper case IDs
- DM Notifications: Users receive appropriate DMs for all automod punishments
- Appeal Integration: Automod bans include full appeal system integration
tomo-bot/
βββ commands/ # Slash commands
β βββ general/ # Public commands (help, afk)
β βββ moderation/ # Mod commands (ban, unban, warn, warnings, delwarn, kick, lock, unlock, slowmode, search, notes, userinfo)
β βββ util/ # Utility commands (config)
βββ data/ # JSON database files
βββ events/ # Discord.js event handlers
βββ handlers/ # Component handlers
βββ helpers/ # Utility functions
βββ interactions/ # Discord interactions
β βββ buttons/ # Button interactions (including search functionality)
β βββ menus/ # Select menu interactions
β βββ modals/ # Modal form interactions (including search modal)
βββ models/ # Data models and database
β βββ BaseModel.js # Base database model
β βββ ConfigModel.js # Configuration management
β βββ ModerationActionModel.js # Case and action tracking
β βββ UserNotesModel.js # Staff notes system
βββ utils/ # Shared utilities
βββ index.js # Main bot entry point
{
"type": "ban|unban|mute|unmute|kick|warn",
"userId": "123456789012345678",
"moderatorId": "123456789012345678",
"reason": "Rule violation",
"duration": "1h|1d|permanent",
"caseId": "0001",
"timestamp": "2023-12-01T12:00:00.000Z"
}{
"userId": "123456789012345678",
"moderatorId": "123456789012345678",
"note": "User was very cooperative during appeal process",
"timestamp": "2023-12-01T12:00:00.000Z",
"id": "1701432000000"
}{
"caseId": "0001",
"userId": "123456789012345678",
"reason": "Why ban should be lifted",
"learned": "What they learned",
"comments": "Additional comments",
"contact": "Alternative contact info",
"status": "pending|approved|denied",
"submittedAt": "2023-12-01T12:00:00.000Z",
"processedAt": "2023-12-01T13:00:00.000Z",
"processedBy": "123456789012345678"
}
### Configuration
```json
{
"id": "global",
"staffRoles": ["role_id_1", "role_id_2"],
"logsChannelId": "123456789012345678",
"appealInvite": "https://discord.gg/appeals",
"loggingEnabled": true,
"appealsEnabled": true,
"automodEnabled": true,
"automodRules": [
{
"threshold": 3,
"action": "mute",
"duration": 3600000
},
{
"threshold": 5,
"action": "kick"
},
{
"threshold": 7,
"action": "ban"
}
],
"banEmbed": {
"title": "π¨ You have been banned",
"description": "You have been banned from **{server}**",
"color": 16761769,
"footer": "Contact staff if you believe this is a mistake"
},
"commands": {
"ban": {
"enabled": true,
"isPublic": false,
"whitelist": [],
"blacklist": []
}
}
}
logAction(data)- Log a new moderation actiongetCase(caseId)- Get a specific casedeleteCase(caseId)- Delete a specific casegetUserCases(userId)- Get all cases for a usergetUserWarnings(userId, guildId)- Get all warnings for a usergetStatistics()- Get server-wide statisticsgetModeratorStatistics(moderatorId)- Get moderator statisticsfind(query)- Search moderation logs with filtering
addNote(userId, moderatorId, note)- Add a staff note to a usergetUserNotes(userId)- Get all notes for a specific userdeleteNote(noteId)- Remove a specific note by IDgetAllNotes()- Get all notes (admin use)
getConfig()- Get current configurationsetConfig(data)- Update configurationsetBanEmbedTemplate(data)- Set custom ban embed templategetBanEmbedTemplate()- Get current ban embed templatesetAppealInvite(invite)- Set Discord appeal server invitesetLoggingEnabled(enabled)- Toggle logging systemsetAppealsEnabled(enabled)- Toggle appeals systemsetAutomodEnabled(enabled)- Toggle automod systemaddAutomodRule(threshold, action, duration)- Add automod ruleremoveAutomodRule(threshold)- Remove automod rulegetAutomodRules()- Get all automod rulesgetAutomodActionForWarnings(count)- Get applicable automod actioncheckCommandPermission(command, userRoles, isOwner)- Check permissionsregisterCommand(name, isPublic, enabled)- Register new command
requirePermission(interaction, command)- Enforce command permissionscheckCommandPermission(interaction, command)- Check without enforcinghasPermission(interaction, command)- Simple boolean check
info(message, data)- Log informationerror(message, error)- Log errorswarn(message, data)- Log warnings
The bot uses a consistent pink theme defined in:
- Color:
0xFFB6C1(Light Pink) - Emojis: πΈ, π, π, β¨, π
- Tone: Friendly, cute, supportive
-
Create Command File
// commands/category/newcommand.js const { SlashCommandBuilder } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('newcommand') .setDescription('Description here'), isPublic: false, // true for public commands async execute(interaction) { // Command logic here } };
-
Add Permission Check (for staff commands)
const permissionChecker = require('../../utils/permissionChecker'); async execute(interaction) { const hasPermission = await permissionChecker.requirePermission(interaction, 'newcommand'); if (!hasPermission) return; // Command logic here }
-
Button Interactions
// interactions/buttons/newbutton.js module.exports = { customId: 'newbutton', // or regex: /^newbutton_\d+$/ async execute(interaction) { // Button logic here } };
-
Modal Interactions
// interactions/modals/newmodal.js module.exports = { customId: 'newmodal', async execute(interaction) { // Modal logic here } };
- Check bot token in
.env - Verify bot has necessary permissions
- Check console for error messages
- Ensure bot is online in Discord
- Check if commands are registered:
/config β Commands - Verify user has required permissions
- Check if command is enabled in configuration
- Review blacklist/whitelist settings
- Verify appeals system is enabled:
/config β Logs β Enable Appeals - Check appeal server invite is set:
/config β Logs β Set Appeal Server Invite - Ensure ban message template includes {appealInvite} variable
- Test custom ban message template with preview feature
- Verify staff roles are configured:
/config β Staff - Check command-specific permissions:
/config β Commands - Ensure user has required Discord permissions
- Review bot's role hierarchy position
Enable detailed logging by setting:
DEBUG=true
LOG_LEVEL=debug- Fork the Repository
- Create Feature Branch
git checkout -b feature/amazing-feature
- Commit Changes
git commit -m 'Add amazing feature' - Push to Branch
git push origin feature/amazing-feature
- Open Pull Request
- Use consistent indentation (2 spaces)
- Add JSDoc comments for functions
- Follow Discord.js v14 best practices
- Include error handling
- Maintain the cute/friendly tone
This project is licensed under the MIT License - see the LICENSE file for details.
- There is none: seriously, theres no support.
- User who provided feedback
- The Discord community for inspiration lol
Made with π by Synz