A feature-rich Discord bot with moderation, tickets, temp VCs, and logging.
- Moderation system
- Ticket system
- Temp Voice Channels
- VC Control Panel (with custom image support)
- AFK system
- Utility commands
- Multi-server SQLite architecture
- Per-guild configuration
- Custom emoji support
- Multi-owner Bot management
- Rich Presence control
All commands work as both Slash Commands (/) and Prefix Commands (default !). Aliases are for Prefix usage only.
| Command | Aliases | Description | Permission |
|---|---|---|---|
/ban |
forceban, hackban |
Ban a member from the server | Ban Members |
/kick |
remove |
Kick a member from the server | Kick Members |
/mute |
timeout |
Timeout (mute) a member | Moderate Members |
/unmute |
untimeout, unsilence |
Remove timeout (unmute) from a member | Moderate Members |
/warn |
warning |
Warn a member | Moderate Members |
/purge |
clear, clean, prune |
Bulk delete messages (img, gif, video, link, attach) | Manage Messages |
/nick |
nickname, setnick, changenick |
Change a nickname | Manage Nicknames* |
/drag |
pull, move, summon |
Drag a user to a voice channel | Move Members |
/vckick |
vcremove, disconnectuser, dvc, forcedc |
Disconnect a user from a voice channel | Move Members |
/vckickall |
vcpurge, kickall, emptyvc, clearvc |
Disconnect everyone from a voice channel | Move Members |
/dump |
rolememebers, rmembers, rolelist, rd |
Show all members with a specific role | Manage Roles |
/role |
giverole, removerole, addrole, |
Toggle a role on a user (add if missing, remove if present) | Manage Roles |
(Note: Users with Change Nickname can change their own nickname without Manage Nicknames)
| Command | Aliases | Description | Permission |
|---|---|---|---|
/setup |
configure, botsetup |
Configure the bot for this server | Administrator |
/config |
(None) | View current bot configuration | Administrator |
/resetconfig |
(None) | Reset configuration for this server | Administrator |
/noprefix |
np |
Manage no-prefix users | Bot Owner |
/rpc |
presence, activity |
Change the bot rich presence | Administrator |
/status |
stats, botinfo, info |
Show the bot current stats and health | Administrator |
| Command | Aliases | Description | Permission |
|---|---|---|---|
/panel |
(None) | Send a ticket panel embed with an Open Ticket button | Manage Channels |
| Command | Aliases | Description | Permission |
|---|---|---|---|
/av |
avatar, pfp, icon |
Show a user's avatar | @everyone |
/banner |
userbanner, profilebanner |
Show a user's profile banner | @everyone |
/sicon |
servericon, guildicon |
Show the server icon | @everyone |
/sbanner |
serverbanner, guildbanner |
Show the server banner | @everyone |
/serverinfo |
si, server, guildinfo, guild |
Show server information | @everyone |
/userinfo |
ui, whois, user, lookup |
Show user information | @everyone |
/purgebots |
cleanbots, deletebots |
Purge last X bot messages from this channel | Manage Messages |
/purgeuser |
cleanuser, deleteuser, pu |
Purge last X messages from a specific user | Manage Messages |
/afk |
away, brb |
Set your AFK status | @everyone |
/vcpanel |
vcp, voicepanel, vccontrols |
Resend the VC control panel in your voice channel | @everyone* |
(Note: /vcpanel is only usable by the creator of the temporary voice channel)
- Node.js v16 or higher
- A Discord bot token
- Git
-
Clone the repo
git clone https://github.com/Ramsingh4656/my-bot.git cd my-bot -
Install dependencies
npm install
-
Create .env file Create a
.envfile in the root directory and add the following:TOKEN=your_bot_token CLIENT_ID=your_client_id GUILD_ID=your_guild_id PREFIX=! OWNER_IDS=your_discord_id,another_id VC_PANEL_IMAGE=optional_panel_image_url
-
Register slash commands
node deploy-commands.js
-
Start the bot
node index.js
-
Production (PM2)
npm install -g pm2 pm2 start index.js --name my-bot pm2 startup pm2 save
ALL setup is done inside Discord via slash commands β no .env editing needed for server specific configuration!
/setup ticketsβ Set up the ticket system (Category, Log channel, Transcript channel)/setup tempvcβ Set up the temp voice channel system (Category, Hub Trigger VC)/setup duoβ Set the duo VC trigger channel/configβ View current settings and setup status/resetconfigβ Reset configuration for the server
Before running the /setup commands, you should create the following channels in your server:
- π Tickets (category)
- π Temp VCs (category)
#ticket-log(text channel)#transcripts(text channel)- π
β Create VC(voice channel - Hub Trigger) - π
β Create Duo(voice channel - Duo Trigger)
- Admin runs
/panelin a channel to drop the ticket embed. - User clicks the Open Ticket button.
- User types a reason in the popup modal (10-500 characters).
- A private channel is created in the Ticket Category.
- Staff members interact with the user and click Close Ticket when finished.
- An HTML transcript is saved, sent to the transcript channel, and logged to the log channel.
- The ticket channel is deleted after 5 seconds.
- Hub VC: Unlimited users. Channel is named
"{displayName}'s VC". - Duo VC: Max 2 users. Channels are sequentially named
π’γ»duo ΒΉ,π’γ»duo Β², etc. - Auto-deletes when all humans leave the channel.
- A VC Control Panel is sent inside each VC's text chat automatically upon creation.
- If deleted, the creator can resend it using
/vcpanel.
The creator of the VC can use the following buttons:
- Rename: Open a modal to change the channel name.
- Limit: Open a modal to set the user limit (0-99).
- Lock: Block new joins (
Connect: false). - Unlock: Allow joins.
- Hide: Hide the channel from the channel list (
ViewChannel: false). - Unhide: Show the channel in the list.
- Waiting: Create a waiting room (
ViewChannel: true,Connect: false). - Trust: Select a user to bypass locks and hiding.
- Reject: Select a user to reject and remove from the VC.
- Delete: Instantly delete the voice channel.
- Kick: Select a user to disconnect from the VC.
- Ban: Select a user to disconnect and permanently block from the VC.
- Use
/afk [reason]or!afk [reason]to go AFK. - The bot will add an
[AFK]tag to your nickname if permissions allow. - If someone mentions you, the bot notifies them how long you've been away and your reason.
- Your AFK status is automatically removed the next time you send a message.
All bot emojis are centrally managed in config/emojis.js.
To use your own server emojis:
- Type
\:emojiname:in your Discord server to get the raw ID. - Open
config/emojis.js. - Replace the placeholder with your custom emoji ID string.
Format:
success: '<:success:123456789012345678>',This bot uses SQLite via the sql.js library (pure JavaScript, no native binaries required).
- No installation needed; database is automatically created on first run.
- Stored in
data/bot.db(auto-managed). - Tables:
guild_configs: Stores all per-server settings and channel IDs.ticket_count: Tracks the incremental ticket numbers per server.noprefix_users: Stores users with no-prefix access per server.afk_users: Stores current AFK status and reasons per server.command_roles: Stores role restrictions for specific commands.
my-bot/
βββ commands/
β βββ mod/ β Moderation commands
β βββ tickets/ β Ticket panel
β βββ setup/ β Bot configuration
β βββ util/ β Utility commands
βββ database/ β SQLite DB layer
βββ events/ β Discord event handlers
βββ utils/ β Shared utilities
β βββ buildVcPanel.jsβ VC panel builder
βββ config/
β βββ emojis.js β Custom emoji config
βββ data/ β Runtime data (DB, presence)
βββ index.js β Bot entry point
βββ config.js β Bot config
βββ deploy-commands.jsβ Slash command registrar
Ownership is managed globally via the .env file (OWNER_IDS).
- To add owners, add their Discord user IDs separated by commas in your
.env. - Owners can grant/revoke no-prefix access.
/noprefix add <user>β Grant a user no-prefix access (Owner only)./noprefix remove <user>β Revoke no-prefix access (Owner only)./noprefix listβ View all owners and no-prefix users.- Note: Bot owners must be added to no-prefix explicitly if they wish to use commands without a prefix.
Admin-only commands to update the bot's status across all servers. Persists across restarts.
/rpc type:PLAYING text:<text>/rpc type:WATCHING text:<text>/rpc type:LISTENING text:<text>/rpc type:COMPETING text:<text>/rpc type:CLEAR
- All normal commands: 3 second cooldown.
- Setup & Noprefix commands: 5 second cooldown.
- Command error replies are ephemeral in slash commands and automatically deleted after 5 seconds for prefix commands.
- Success messages for mass-action commands (Purge, VC Kick) are also deleted after 5 seconds.
MIT