Add Sentinel anti-nuke listeners, federation role syncing, ticket system, and admin commands to the unified AeThex bot, consolidating functionality and enhancing security monitoring. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e72fc1b7-94bd-4d6c-801f-cbac2fae245c Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 00c4494a-b436-4e48-b794-39cd745fb604 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/e72fc1b7-94bd-4d6c-801f-cbac2fae245c/7DQc4BR Replit-Helium-Checkpoint-Created: true
129 lines
2.9 KiB
JavaScript
129 lines
2.9 KiB
JavaScript
const { REST, Routes } = require('discord.js');
|
|
require('dotenv').config();
|
|
|
|
const commands = [
|
|
{
|
|
name: 'ticket',
|
|
description: 'Ticket management system',
|
|
options: [
|
|
{
|
|
name: 'create',
|
|
type: 1,
|
|
description: 'Create a new support ticket',
|
|
options: [
|
|
{
|
|
name: 'reason',
|
|
type: 3,
|
|
description: 'Brief reason for opening this ticket',
|
|
required: true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'close',
|
|
type: 1,
|
|
description: 'Close the current ticket',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'admin',
|
|
description: 'Admin monitoring commands',
|
|
default_member_permissions: '8',
|
|
options: [
|
|
{
|
|
name: 'status',
|
|
type: 1,
|
|
description: 'View bot status and statistics',
|
|
},
|
|
{
|
|
name: 'heat',
|
|
type: 1,
|
|
description: 'Check heat level of a user',
|
|
options: [
|
|
{
|
|
name: 'user',
|
|
type: 6,
|
|
description: 'User to check',
|
|
required: true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'servers',
|
|
type: 1,
|
|
description: 'View all servers the bot is in',
|
|
},
|
|
{
|
|
name: 'threats',
|
|
type: 1,
|
|
description: 'View current heat map (active threats)',
|
|
},
|
|
{
|
|
name: 'federation',
|
|
type: 1,
|
|
description: 'View federation role mappings',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'federation',
|
|
description: 'Manage cross-server role sync',
|
|
default_member_permissions: '8',
|
|
options: [
|
|
{
|
|
name: 'link',
|
|
type: 1,
|
|
description: 'Link a role for cross-server syncing',
|
|
options: [
|
|
{
|
|
name: 'role',
|
|
type: 8,
|
|
description: 'Role to sync across realms',
|
|
required: true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'unlink',
|
|
type: 1,
|
|
description: 'Remove a role from cross-server syncing',
|
|
options: [
|
|
{
|
|
name: 'role',
|
|
type: 8,
|
|
description: 'Role to remove from sync',
|
|
required: true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'list',
|
|
type: 1,
|
|
description: 'List all linked roles',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'status',
|
|
description: 'View network status and bot health',
|
|
},
|
|
];
|
|
|
|
const token = process.env.DISCORD_BOT_TOKEN || process.env.DISCORD_TOKEN;
|
|
const rest = new REST({ version: '10' }).setToken(token);
|
|
|
|
(async () => {
|
|
try {
|
|
console.log('Registering slash commands...');
|
|
|
|
const data = await rest.put(
|
|
Routes.applicationCommands(process.env.DISCORD_CLIENT_ID),
|
|
{ body: commands }
|
|
);
|
|
|
|
console.log(`Successfully registered ${data.length} commands`);
|
|
} catch (error) {
|
|
console.error('Error registering commands:', error);
|
|
}
|
|
})();
|