Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 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
9109dc8
Improve moderation commands with bug fixes and enhanced functionality
May 27, 2026
046e080
Implement comprehensive moderation punishment tracking and evasion pr…
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
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
235 changes: 9 additions & 226 deletions src/commands/Core/help.js
Original file line number Diff line number Diff line change
@@ -1,234 +1,17 @@
import {
SlashCommandBuilder,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
} from "discord.js";
import { InteractionHelper } from '../../utils/interactionHelper.js';
import { createEmbed } from "../../utils/embeds.js";
import {
createSelectMenu,
} from "../../utils/components.js";
import fs from "fs/promises";
import path from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const CATEGORY_SELECT_ID = "help-category-select";
const ALL_COMMANDS_ID = "help-all-commands";
const BUG_REPORT_BUTTON_ID = "help-bug-report";
const HELP_MENU_TIMEOUT_MS = 5 * 60 * 1000;

const CATEGORY_ICONS = {
Core: "ℹ️",
Moderation: "🛡️",
Economy: "💰",
Fun: "🎮",
Leveling: "📊",
Utility: "🔧",
Ticket: "🎫",
Welcome: "👋",
Giveaway: "🎉",
Counter: "🔢",
Tools: "🛠️",
Search: "🔍",
Reaction_Roles: "🎭",
Community: "👥",
Birthday: "🎂",
Config: "⚙️",
};





export async function createInitialHelpMenu(client) {
const commandsPath = path.join(__dirname, "../../commands");
const categoryDirs = (
await fs.readdir(commandsPath, { withFileTypes: true })
)
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name)
.sort();

const options = [
{
label: "📋 All Commands",
description: "View all available commands with pagination",
value: ALL_COMMANDS_ID,
},
...categoryDirs.map((category) => {
const categoryName =
category.charAt(0).toUpperCase() +
category.slice(1).toLowerCase();
const icon = CATEGORY_ICONS[categoryName] || "🔍";
return {
label: `${icon} ${categoryName}`,
description: `View commands in the ${categoryName} category`,
value: category,
};
}),
];

const botName = client?.user?.username || "Bot";
const embed = createEmbed({
title: `🤖 ${botName} Help Center`,
description: "Your all-in-one Discord companion for moderation, economy, fun, and server management.",
color: 'primary'
});

embed.addFields(
{
name: "🛡️ **Moderation**",
value: "Server moderation, user management, and enforcement tools",
inline: true
},
{
name: "💰 **Economy**",
value: "Currency system, shops, and virtual economy",
inline: true
},
{
name: "🎮 **Fun**",
value: "Games, entertainment, and interactive commands",
inline: true
},
{
name: "📊 **Leveling**",
value: "User levels, XP system, and progression tracking",
inline: true
},
{
name: "🎫 **Tickets**",
value: "Support ticket system for server management",
inline: true
},
{
name: "🎉 **Giveaways**",
value: "Automated giveaway management and distribution",
inline: true
},
{
name: "👋 **Welcome**",
value: "Member welcome messages and onboarding",
inline: true
},
{
name: "🎂 **Birthdays**",
value: "Birthday tracking and celebration features",
inline: true
},
{
name: "👥 **Community**",
value: "Community tools, applications, and member engagement",
inline: true
},
{
name: "⚙️ **Config**",
value: "Server and bot configuration management commands",
inline: true
},
{
name: "🔢 **Counter**",
value: "Live counter channel setup and counter controls",
inline: true
},
{
name: "🎙️ **Join to Create**",
value: "Dynamic voice channel creation and management",
inline: true
},
{
name: "🎭 **Reaction Roles**",
value: "Self-assignable roles using reaction-role systems",
inline: true
},
{
name: "✅ **Verification**",
value: "Member verification workflows and access gating",
inline: true
},
{
name: "🔧 **Utilities**",
value: "Useful tools and server utilities",
inline: true
}
);

embed.setFooter({
text: "Made with ❤️"
});
embed.setTimestamp();

const bugReportButton = new ButtonBuilder()
.setCustomId(BUG_REPORT_BUTTON_ID)
.setLabel("Report Bug")
.setStyle(ButtonStyle.Danger);

const supportButton = new ButtonBuilder()
.setLabel("Support Server")
.setURL("https://discord.gg/QnWNz2dKCE")
.setStyle(ButtonStyle.Link);

const touchpointButton = new ButtonBuilder()
.setLabel("Learn from Touchpoint")
.setURL("https://www.youtube.com/@TouchDisc")
.setStyle(ButtonStyle.Link);

const selectRow = createSelectMenu(
CATEGORY_SELECT_ID,
"Select to view the commands",
options,
);

const buttonRow = new ActionRowBuilder().addComponents([
bugReportButton,
supportButton,
touchpointButton,
]);

return {
embeds: [embed],
components: [buttonRow, selectRow],
};
}
import { SlashCommandBuilder } from "discord.js";
import { createInitialHelpMenu } from "../../utils/helpMenuHelper.js";

export default {
data: new SlashCommandBuilder()
.setName("help")
.setDescription("Displays the help menu with all available commands"),

.setDescription("Displays the help menu"),
async execute(interaction, guildConfig, client) {
// Lấy client an toàn
const activeClient = client || interaction.client;

const { MessageFlags } = await import('discord.js');
await InteractionHelper.safeDefer(interaction);

const { embeds, components } = await createInitialHelpMenu(client);

await InteractionHelper.safeEditReply(interaction, {
embeds,
components,
});

setTimeout(async () => {
try {
const closedEmbed = createEmbed({
title: "Help menu closed",
description: "Help menu has been closed, use /help again.",
color: "secondary",
});

await InteractionHelper.safeEditReply(interaction, {
embeds: [closedEmbed],
components: [],
});
} catch (error) {

}
}, HELP_MENU_TIMEOUT_MS);
await interaction.deferReply({ ephemeral: true });
const { embeds, components } = await createInitialHelpMenu(activeClient);
await interaction.editReply({ embeds, components });
},
};


Loading