TitanBot README

The project's README from github.com/codebymitch/TitanBot. As one markdown file: README.md.

TitanBot - Ultimate Discord Bot

TitanBot is a powerful, feature-rich Discord bot designed to enhance your server experience with comprehensive moderation tools, engaging economy systems, utility features, and much more. Built with modern Discord.js v14 and PostgreSQL for optimal performance and data persistence.

Support Server Discord.js PostgreSQL

Table of Contents

Features Overview

TitanBot offers a complete suite of tools for Discord server management and community engagement:

Moderation & Administration

  • Mass Actions - Bulk ban/kick capabilities
  • User Notes - Keep detailed moderation records
  • Case Management - View and track all mod actions

Economy System

  • Shop & Inventory - Buy and manage items
  • Gambling - Risk it for rewards
  • Pay System - Transfer money between users

Fun & Entertainment

  • Random Facts - Learn something new
  • Wanted Poster - Create fun wanted images
  • Text Reversal - Reverse any text

Advanced Ticket System

  • Claim & Priority - Staff ticket management
  • Ticket Limits - Prevent spam
  • Transcript System - Save ticket history

Server Stats

  • Member Counter - Live member count channels
  • Voice Counters - Track voice stats
  • Dynamic Updates - Real-time channel updates

Reaction Roles

  • Role Assignment - Self-assignable roles
  • Emoji Selection - Reaction-based system
  • Multi-role Support - Multiple role options

Leveling & XP System

  • XP Tracking - Automatic message-based XP
  • Level Roles - Auto-assign roles by level
  • Custom Configuration - Personalize leveling

Giveaways & Events

  • Multiple Winners - Support multi-winner giveaways
  • Auto Picking - Automatic winner selection
  • Reroll System - Pick new winners if needed

Birthday System

  • Birthday Tracking - Never miss a birthday
  • Auto Announcements - Celebrate automatically
  • Timezone Support - Accurate worldwide tracking

Utility Tools

  • Report System - Report issues to staff
  • Todo Lists - Personal task management
  • First Message - Jump to channel's first message

Welcome System

  • Welcome Messages - Greet new members
  • Auto Roles - Assign roles on join
  • Custom Embeds - Personalized messages

Music

  • 24/7 Mode - Play music 24/7
  • Interative Button System - Manage music through buttons
  • Supports EVERY platform - Supports spotify, deezer, youtube, apple music

Video Tutorial

For a detailed step-by-step setup guide, watch our comprehensive video tutorial: TitanBot Setup Tutorial

TitanBot is fully containerized for easy deployment.

  1. Clone the repository:

    git clone https://github.com/codebymitch/TitanBot.git
    cd TitanBot
    
  2. Configure environment variables:

    cp .env.example .env
    

    Set at minimum DISCORD_TOKEN, CLIENT_ID, and GUILD_ID. Docker Compose also reads POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB from .env (defaults: titanbot / password / titanbot).

  3. Build and start the containers:

    docker compose up -d --build
    
  4. Check status:

    docker compose ps
    curl http://localhost:3000/health
    

This starts the bot and PostgreSQL. The compose file sets POSTGRES_SSL=false and AUTO_MIGRATE=true for the bundled database. Music uses public Lavalink v4 nodes from lavalink/nodes.json by default.

Music

Music uses Lavalink v4 via Riffy, similar to Musicify.

  1. By default, the bot loads multiple public v4 SSL nodes from lavalink/nodes.json (sourced from lavalink.darrennathanael.com). Edit that file to add or remove nodes.
  2. To self-host Lavalink instead, run docker compose --profile local-lavalink up -d and set single-node env vars in .env:
    LAVALINK_HOST=lavalink
    LAVALINK_PORT=2333
    LAVALINK_PASSWORD=youshallnotpass
    LAVALINK_SECURE=false
    
    Remove or rename lavalink/nodes.json so the bot falls back to those env vars.
  3. Override nodes inline with LAVALINK_NODES (JSON array) or point at another file with LAVALINK_NODES_FILE.
  4. Use /play <song> from a voice channel, or /join to connect without playing. Prefix shortcuts: join, np, leave, pause, resume, skip, stop, volume <0-100>, or music <subcommand>. Use /nowplaying and /queue for status; /music for loop, shuffle, seek, and other controls.

Using GitHub Container Registry

The bot is automatically published to GitHub Container Registry on every push to main.

docker pull ghcr.io/codebymitch/titanbot:main

Manual Installation Steps

Prerequisites

  1. Clone the Repository

    git clone https://github.com/codebymitch/TitanBot.git
    cd TitanBot
    
  2. Install Dependencies

    npm install
    
  3. Configure Environment Variables

    cp .env.example .env
    

    Edit .env with your configuration (only the following variables require configuration, leave remaining variables as default):

    # Discord Bot Configuration
    DISCORD_TOKEN=your_discord_bot_token_here
    CLIENT_ID=your_discord_client_id_here
    GUILD_ID=your_discord_guild_id_here
    
    # PostgreSQL Configuration (Primary Database)
    POSTGRES_URL=postgresql://postgres:yourpassword@localhost:5432/titanbot
    POSTGRES_HOST=localhost
    POSTGRES_PORT=5432
    POSTGRES_DB=titanbot
    POSTGRES_USER=postgres
    POSTGRES_PASSWORD=yourpassword
    

    Production note:

    • NODE_ENV=production
    • LOG_LEVEL=warn for a clean production console (critical issues + startup status)
    • LOG_LEVEL=info if you want more detailed operational logs
    • If your chosen PORT is already used, TitanBot automatically tries the next port(s)

    Environment options reference:

    • NODE_ENV: development, production, test (any non-production value is treated as non-production)
    • LOG_LEVEL: error, warn, info, http, verbose, debug, silly
    • Accepted aliases for LOG_LEVEL in this bot: warns, warning, warnings → warn

    Recommended production .env (easy mode + default mode):

    NODE_ENV=production
    LOG_LEVEL=warn
    WEB_HOST=0.0.0.0
    PORT=3000
    PORT_RETRY_ATTEMPTS=5
    

    This gives clear startup/online status messages while keeping logs simple for non-technical operators. If port 3000 is busy, the bot tries the next available ports automatically (up to PORT_RETRY_ATTEMPTS).

Multiple servers

Slash commands are registered globally on startup (via CLIENT_ID), so the bot works in every server it is invited to. GUILD_ID stays in the tutorial .env for setup steps but is not used for command registration.

Notes:

  1. Setup PostgreSQL Database (Optional but recommended)

    # Create database and user
    createdb titanbot
    createuser titanbot
    psql -c "ALTER USER titanbot PASSWORD 'yourpassword';"
    psql -c "GRANT ALL PRIVILEGES ON DATABASE titanbot TO titanbot;"
    
  2. Verify Database Setup

    npm run migrate:check
    
  3. Start the Bot

    npm start
    

Note on database migrations: Schema tables and legacy key migrations run automatically on startup, somanaged hosts like **Railway** need no manual migration step — just deploy/restart. To disable auto-migration setAUTO_MIGRATE=false. You can still run a manual key migration locally with node scripts/migrate-keys.js --dry-run(preview) ornode scripts/migrate-keys.js`.

Required Bot Intents

TitanBot requires the following Discord intents:

Required Permissions

License

TitanBot is released under the MIT License. See LICENSE for details.

Thank You

Thank you for choosing TitanBot for your Discord server! We're constantly working to improve and add new features based on community feedback.

Last updated: May 2026

TitanBot (codebymitch/TitanBot)

Searching Database…

这是什么?一个功能齐全的 Discord 机器人,涵盖管理、经济系统、工单、音乐、等级、抽奖活动、reaction roles、欢迎消息和生日提醒——基于 discord.js v14 开发,使用 PostgreSQL 做数据存储。
所以这不是我下载的应用——它到底运行在哪里?需要你自己部署:可以使用 Docker(推荐)或 Node.js,用你自己的 Discord 机器人应用来运行。每次推送到 main 分支时,镜像都会自动发布到 GitHub Container Registry。
我怎么把它跑起来?克隆仓库,在 .env 中设置 DISCORDTOKEN、CLIENTID 和 GUILDID,然后运行 docker compose up -d——这样就能启动机器人和自带的 PostgreSQL 数据库。还有一个视频教程,手把手带不会写代码的人完成全部安装。
安装之前我需要准备什么?需要一个开启了所需 intents 的 Discord 机器人应用,另外还需要 PostgreSQL(推荐——不装的话可以用内存存储作为备用)。如果手动安装,还需要 Node.js 20.10.0 或更高版本;用 Docker 的话可以跳过这一步。
第一次启动之前有什么需要知道的?全局斜杠命令在首次部署后可能需要大约一小时才能显示出来。音乐功能还依赖 Lavalink v4 节点——已经预配置好了公共节点,你也可以自己搭一个节点。
音乐功能需要我自己架设音频服务器吗?不需要——音乐通过 Riffy 使用 Lavalink v4 运行,lavalink/nodes.json 里已经预置了公共 SSL 节点。如果想自己搭节点,运行 docker compose --profile local-lavalink up -d 即可。支持 Spotify、Deezer、YouTube 和 Apple Music,提供 /play、按钮控制,以及 skip、queue、volume 这类前缀快捷命令。
一个部署能同时服务多个 Discord 服务器吗?可以。斜杠命令通过 CLIENTID 全局注册,所以机器人被邀请到哪个服务器就能在哪个服务器使用(OAuth2 scopes:bot 和 applications.commands)。每个服务器的数据是相互隔离的——配置、经济、工单、等级和警告记录都按服务器分开保存。
管理员用它具体能做什么?支持批量封禁/踢人、针对单个用户的管理备注、完整的案例记录,以及管理员举报系统。执行操作时它需要 Kick Members、Ban Members、Manage Roles、Manage Messages 和 Manage Channels 等权限。
除了管理功能,普通成员能玩些什么?有一套经济系统,包含商店、背包、赌博和转账;有基于消息的 XP 经验值和自动授予的等级身份组;有多位中奖者的抽奖活动,支持自动开奖和重抽;有结合时区的生日提醒;有带自动身份组的欢迎消息;还有一个支持认领、优先级和聊天记录导出的工单系统。
Size
3.1 MB
Stars
9K
Age
8mo
Commits · 90 Days