Skip to content
Open

Idk #81

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
4883c2a
Update bot configuration with new names and colors
NHStarlight May 21, 2026
61ef04e
Refactor moderation cases command error handling
NHStarlight May 25, 2026
1273869
Improve error handling and user messages in cases command
NHStarlight May 25, 2026
6ed93f4
Update moderation case messages to English
NHStarlight May 25, 2026
ad5054c
Improve error handling and no cases message
NHStarlight May 25, 2026
5206118
Refactor moderation.js for better logging and case handling
NHStarlight May 25, 2026
5ff6fa3
Refactor purge command for clarity and error handling
NHStarlight May 25, 2026
268877a
Refactor purge command for message deletion
NHStarlight May 25, 2026
b024449
Refactor purge command for message deletion
NHStarlight May 25, 2026
74ab15e
fix purge bug 2nd
NHStarlight May 25, 2026
2297bd3
Refactor purge command message deletion logic
NHStarlight May 25, 2026
96f47cb
Update purge command messages, descriptions and translate to english.
NHStarlight May 25, 2026
4e6dd7e
Refactor lock command for improved clarity
NHStarlight May 25, 2026
26438ef
Update lock command to lock channel instantly
NHStarlight May 25, 2026
cb3e33d
Refactor unlock command for improved functionality
NHStarlight May 25, 2026
baa15c3
Refactor lock command comments and reply method
NHStarlight May 25, 2026
37209bb
Update lock command description and functionality
NHStarlight May 25, 2026
79d83dd
Update unlock command description and logic
NHStarlight May 25, 2026
f0754eb
Update unlock command description and error handling
NHStarlight May 25, 2026
bb299f2
Refactor lock command to simplify role locking
NHStarlight May 25, 2026
8d1ae36
Refactor message handling and leveling logic
NHStarlight May 25, 2026
491a4dd
Fix missing newline at end of messageCreate.js
NHStarlight May 25, 2026
47f24df
Refactor message handling and command execution
NHStarlight May 25, 2026
1d45737
Refactor messageCreate to remove leveling logic
NHStarlight May 25, 2026
4b3130f
Refactor message command handling with switch case
NHStarlight May 25, 2026
0588f6e
Refactor command handling into a commands list
NHStarlight May 25, 2026
1e6d786
Update command messages to English and improve comments
NHStarlight May 25, 2026
5b015f7
Refactor command list and improve comments
NHStarlight May 25, 2026
929f668
Refactor messageCreate.js to include permissions checks
NHStarlight May 25, 2026
3ce32bf
Rename package and update description in package.json
NHStarlight May 25, 2026
6c8f442
Update helpButtons.js
NHStarlight May 25, 2026
f22c3a4
Refactor help menu and update bot details
NHStarlight May 25, 2026
7fa16e8
Improve bug report button interaction handling
NHStarlight May 25, 2026
9fe2c69
Refactor helpButtons.js to include help menu
NHStarlight May 25, 2026
ad71adc
Delete src/interactions/buttons/help.js
NHStarlight May 25, 2026
de76233
Implement quarantine command for moderation
NHStarlight May 25, 2026
045783d
Enhance quarantine command with role management
NHStarlight May 25, 2026
e50cada
Add setup command for Quarantine role
NHStarlight May 25, 2026
704caf4
Add unquarantine command for moderation
NHStarlight May 25, 2026
23ea09f
Modify quarantine command to save roles before removal
NHStarlight May 25, 2026
5d0c488
Enhance unquarantine command to restore user roles
NHStarlight May 25, 2026
e95a266
Add delete_table.js to drop 'role-save' table
NHStarlight May 25, 2026
d5e13cd
Update quarantine command to use JSON for roles
NHStarlight May 25, 2026
ab0d810
Update unquarantine.js
NHStarlight May 25, 2026
bccfb6c
Update quarantine command descriptions and replies
NHStarlight May 25, 2026
fd6074a
Add command alias mapping in aliases.js
NHStarlight May 26, 2026
bccd927
Refactor command handling to use commandLoader
NHStarlight May 26, 2026
f5f87fb
Refactor message handling to remove alias support
NHStarlight May 26, 2026
4fb6846
Improve fake interaction for command execution
NHStarlight May 26, 2026
288dbdc
Improve unquarantine command messages and checks
NHStarlight May 26, 2026
90f8c11
Refactor quarantine command for improved error handling
NHStarlight May 26, 2026
2e62a2c
Enhance quarantine setup command functionality
NHStarlight May 26, 2026
00e47d0
Enhance quarantine command with DB integration
NHStarlight May 26, 2026
6a388c8
Ensure database table for quarantine data exists
NHStarlight May 26, 2026
c8fbca1
Refactor unquarantine command to use database
NHStarlight May 26, 2026
00f060b
Refactor quarantine command to simplify role handling
NHStarlight May 26, 2026
94ca21e
Refactor quarantine command for better error handling
NHStarlight May 26, 2026
91e08ed
Refactor unquarantine command to use new db path
NHStarlight May 26, 2026
b2d5b9e
Update database import path in delete_table.js
NHStarlight May 26, 2026
e93be4a
Delete src/commands/Utility/delete_table.js
NHStarlight May 26, 2026
c9144e2
Delete src/commands/Economy directory
NHStarlight May 26, 2026
781d267
Remove Economy category from help command
NHStarlight May 26, 2026
d92b9f0
Refactor help command to use native deferReply
NHStarlight May 26, 2026
3d0e789
Refactor help.js for improved readability
NHStarlight May 26, 2026
7611d45
Log help command invocation
NHStarlight May 26, 2026
724c85a
Refactor help command and remove unused fields
NHStarlight May 26, 2026
981afe1
Add help-bug-report interaction handler
NHStarlight May 26, 2026
bceba03
Refine help command descriptions and labels
NHStarlight May 26, 2026
ff55942
Fix client reference in help command
NHStarlight May 26, 2026
1e4fb81
Update help command to use link button for reporting
NHStarlight May 26, 2026
83a40c8
Add auto-acknowledge for button and select menu interactions
NHStarlight May 26, 2026
1163a9c
Refactor help command to include pagination and bug report
NHStarlight May 26, 2026
82c3e20
Refactor help command logic and update comments
NHStarlight May 26, 2026
d54e2ee
Add helpMenuHelper utility for help menu pagination logic
NHStarlight May 26, 2026
edc8103
Refactor help.js to use helpMenuHelper utility
NHStarlight May 26, 2026
267b8d8
Fix help button handler with proper pagination
NHStarlight May 26, 2026
869d061
Add help-category-select menu handler to complete help system flow
NHStarlight May 26, 2026
95aa814
Add debug logs to help button handler to diagnose pagination issue
NHStarlight May 26, 2026
4193431
Add debug logs to interactionCreate to diagnose button/menu parsing
NHStarlight May 26, 2026
d9337b6
Fix customId format in createHelpPaginationButtons to match help handler
NHStarlight May 26, 2026
df3c4f8
Replace helpSelectMenus with streamlined version using helpMenuHelper
NHStarlight May 26, 2026
23a510d
Add command descriptions, All Commands view, and fix pagination page …
NHStarlight May 26, 2026
620779e
Update helpMenuHelper.js
NHStarlight May 26, 2026
b169c24
Update messageCreate.js
NHStarlight May 26, 2026
e8d3583
Update lock.js
NHStarlight May 26, 2026
3d8e635
Update purge.js
NHStarlight May 26, 2026
d5b1c58
Update help-category-select.js
NHStarlight May 26, 2026
42cfcb9
Update messageCreate.js
NHStarlight May 26, 2026
c0c9ce9
Update help.js
NHStarlight May 26, 2026
af06c66
Update help-category-select.js
NHStarlight May 26, 2026
a7574af
Update messageCreate.js
NHStarlight May 26, 2026
2327bfe
Update database configuration to use environment variables
May 26, 2026
932f8a7
Fix numerous bugs and improve logging throughout the application
May 26, 2026
0e86de2
Improve parallel execution of commands using slash and prefix
May 26, 2026
c1ac6dc
Improve command execution by enabling prefix and slash commands to wo…
May 26, 2026
210efdf
Fix prefix commands: prevent duplicate replies and add aliases
NHStarlight May 26, 2026
b9cb7af
Add prefix aliases for all bot commands
NHStarlight May 26, 2026
804bbac
English UI, help menu fixes, and prefix improvements
NHStarlight May 26, 2026
90e4a5a
Update README.md
NHStarlight May 26, 2026
c2dce25
Update SECURITY.md
NHStarlight May 26, 2026
2411aec
Update LICENSE
NHStarlight May 26, 2026
275591f
Delete src/services/economyService.js
NHStarlight May 26, 2026
8e1fe85
Delete src/services/economy.js
NHStarlight May 26, 2026
e63a779
Add import statement for app.js
NHStarlight May 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
modules = ["nodejs-18"]
[agent]
expertMode = true
stack = "BEST_EFFORT_FALLBACK"

[nix]
channel = "stable-25_05"

[userenv]

[userenv.shared]
NODE_ENV = "development"
LOG_LEVEL = "info"
LOG_TO_FILE = "false"
PORT = "3000"
WEB_HOST = "0.0.0.0"
PORT_RETRY_ATTEMPTS = "5"
CORS_ORIGIN = "*"
AUTO_MIGRATE = "true"
POSTGRES_MIGRATION_TABLE = "schema_migrations"
SCHEMA_VERSION = "1"
SCHEMA_VERSION_LABEL = "baseline-v1"
BACKUP_DIR = "./backups"
BACKUP_RETENTION_DAYS = "14"

[workflows]
runButton = "Project"

[[workflows.workflow]]
name = "Project"
mode = "parallel"
author = "agent"

[[workflows.workflow.tasks]]
task = "workflow.run"
args = "Start application"

[[workflows.workflow]]
name = "Start application"
author = "agent"

[[workflows.workflow.tasks]]
task = "shell.exec"
args = "node src/app.js"

[workflows.workflow.metadata]
outputType = "console"

[[ports]]
localPort = 3000
externalPort = 80
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 codebymitch
Copyright (c) 2026 NHStarlight

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
258 changes: 2 additions & 256 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,257 +1,3 @@
# TitanBot - Ultimate Discord Bot
# NH_starlightsercurity - Ultimate Sercurity 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](https://img.shields.io/badge/-Support%20Server-%235865F2?logo=discord&logoColor=white&style=flat-square&logoWidth=20)](https://discord.gg/8kJBYhTGW9)
[![Discord.js](https://img.shields.io/npm/v/discord.js?style=flat-square&labelColor=%23202225&color=%23202225&logo=npm&logoColor=white&logoWidth=20)](https://www.npmjs.com/package/discord.js)
![PostgreSQL](https://img.shields.io/badge/-PostgreSQL-%23336791?logo=postgresql&logoColor=white&style=flat-square&logoWidth=20)

## Table of Contents

- [Features Overview](#features-overview)
- [Quick Setup](#quick-setup)
- [Manual Installation Steps](#manual-installation-steps)
- [Support Server](https://discord.gg/QnWNz2dKCE)
- [Required Bot Intents](#bot-intents)
- [Contributing](#contributing)

<a name="features-overview"></a>
## Features Overview

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

<table>
<tr>
<td width="50%" valign="top">

### 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

</td>
<td width="50%" valign="top">

### 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

</td>
</tr>
</table>

<a name="quick-setup"></a>
## Quick Setup (Recommended for non-coders)

### Video Tutorial
For a detailed step-by-step setup guide, watch our comprehensive video tutorial:
[**TitanBot Setup Tutorial**](https://www.youtube.com/@TouchDisc)

## Docker Deployment (Recommended)

TitanBot is fully containerized for easy deployment.

1. **Clone the repository:**
```bash
git clone https://github.com/codebymitch/TitanBot.git
cd TitanBot
```

2. **Configure environment variables:**
Create a `.env` file from `.env.example` and fill in your bot details and PostgreSQL credentials.

3. **Start the containers:**
```bash
docker-compose up -d
```

This will start both the bot and a persistent PostgreSQL database.

### Using GitHub Container Registry

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

```bash
docker pull ghcr.io/codebymitch/titanbot:main
```

<a name="manual-installation-steps"></a>
## Manual Installation Steps

### Prerequisites
- Node.js 18.0.0 or higher
- PostgreSQL server (recommended) or memory storage fallback
- Discord bot application with proper intents

1. **Clone the Repository**
```bash
git clone https://github.com/codebymitch/TitanBot.git
cd TitanBot
```

2. **Install Dependencies**
```bash
npm install
```

3. **Configure Environment Variables**
```bash
cp .env.example .env
```
Edit `.env` with your configuration (only the following variables require configuration, leave remaining variables as default):
```env
# 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):
```env
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`).

4. **Setup PostgreSQL Database** (Optional but recommended)
```bash
# 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;"
```

5. **Test Database Connection**
```bash
npm run test-postgres
```

6. **Start the Bot**
```bash
npm start
```
<a name="bot-intents"></a>

## Required Bot Intents
TitanBot requires the following Discord intents:
- **Guilds**
- **Guild Messages**
- **Message Content**
- **Guild Members**
- **Guild Message Reactions**
- **Guild Voice States**
- **Direct Messages**
- **Bot**
- **Applications.commands**

### Required Permissions
- **View Channels**
- **Send Messages**
- **Embed Links**
- **Attach Files**
- **Read Message History**
- **Manage Messages**
- **Manage Channels**
- **Manage Roles**
- **Kick Members**
- **Manage Messages**
- **Ban Members**
- **Moderate Members**
- **Connect**

<a name="contributing"></a>
## Contributing

We welcome contributions to TitanBot! Here's how you can help:

1. **Fork the repository**
2. **Create a feature branch**
3. **Make your changes**
4. **Test thoroughly**
5. **Submit a pull request**

### Development Guidelines
- Follow existing code style
- Add proper error handling
- Include documentation for new features
- Test with PostgreSQL and memory storage

## License

TitanBot is released under the MIT License. See [LICENSE](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*
**NH_starlightsercurity** is a powerful, feature-rich Discord bot designed to enhance your server experience with comprehensive moderation tools, utility features, and much more. Built with modern Discord.js v14 and PostgreSQL for optimal performance and data persistence.
15 changes: 6 additions & 9 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Security Policy — TitanBot
# Security Policy — NH_starlightsercurity

We take security seriously. If you discover a vulnerability, please follow the policy below so we can triage and address it safely.

## Summary / Self-hosting clarity
TitanBot is distributed as open-source software for self-hosting. We (the maintainers) do not operate self-hosted instances and do not have access to user data or configurations on third-party deployments. Self-hosters are responsible for securing and operating their instances. This policy describes how to report vulnerabilities affecting the project code and guidance for self-hosters who discover security issues in their deployment.
NH_starlightsercurity is distributed as open-source software for self-hosting. We (the maintainers) do not operate self-hosted instances and do not have access to user data or configurations on third-party deployments. Self-hosters are responsible for securing and operating their instances. This policy describes how to report vulnerabilities affecting the project code and guidance for self-hosters who discover security issues in their deployment.

## Reporting a Vulnerability (preferred)
- Preferred channel: Open a private GitHub Security Advisory for this repository (recommended).
- If you cannot use GitHub Advisories, open a ticket: https:
- Do NOT open a public issue with exploit details.

If you found a problem in your self-hosted instance that appears to be due to misconfiguration, please contact the instance operator/host first. If you believe the issue is caused by a vulnerability in TitanBot code, follow the reporting steps above and indicate whether the report comes from a self-hosted deployment.
If you found a problem in your self-hosted instance that appears to be due to misconfiguration, please contact the instance operator/host first. If you believe the issue is caused by a vulnerability in NH_starlightsercurity code, follow the reporting steps above and indicate whether the report comes from a self-hosted deployment.

## Response timelines (what to expect)
- Acknowledgement: within 72 hours.
Expand Down Expand Up @@ -39,7 +39,7 @@ If you found a problem in your self-hosted instance that appears to be due to mi
- Contact info for follow-up.

## Incident reporting from self-hosted deployments
If you operate a self-hosted TitanBot instance and suffer a security incident:
If you operate a self-hosted NH_starlightsercurity instance and suffer a security incident:
- Immediately rotate any exposed secrets (bot token, DB credentials, API keys).
- Take a snapshot of logs/configuration for investigation (avoid sharing secrets).
- If you need upstream help, file a private security advisory and include sanitized reproduction steps and the TitanBot version/commit.
Expand All @@ -66,11 +66,8 @@ If you operate a self-hosted TitanBot instance and suffer a security incident:
- We may assign a CVE or coordinate with CERT/other bodies for high-severity issues.

## Privacy & Telemetry
- TitanBot does not phone home or collect usage data by default. (If you plan to add telemetry, it must be opt-in, documented, and transparent.)
- NH_starlightsercurity does not phone home or collect usage data by default. (If you plan to add telemetry, it must be opt-in, documented, and transparent.)
- Maintainers do not receive data from self-hosted instances. If you choose to enable any telemetry, document what is collected and how to opt out.

## Contact
- Preferred: GitHub Security Advisory for this repository
- Ticket: https:

Thank you for helping keep TitanBot safe.
Thank you for helping keep the NH_starlightsercurity bot - safe.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import './src/app.js';


8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "titanbot-custom",
"name": "starlight-security",
"version": "1.1.1",
"description": "Modular Ultimate Community Bot by Touchpoint Support",
"description": "Starlight Security - Advanced Discord Bot",
"main": "src/app.js",
"type": "module",
"scripts": {
Expand Down
Loading