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
57 lines
2.4 KiB
JavaScript
57 lines
2.4 KiB
JavaScript
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('status')
|
|
.setDescription('View network status and bot health'),
|
|
|
|
async execute(interaction, supabase, client) {
|
|
const guildCount = client.guilds.cache.size;
|
|
const memberCount = client.guilds.cache.reduce((sum, g) => sum + g.memberCount, 0);
|
|
const uptime = Math.floor(process.uptime());
|
|
const hours = Math.floor(uptime / 3600);
|
|
const minutes = Math.floor((uptime % 3600) / 60);
|
|
const seconds = uptime % 60;
|
|
|
|
const realmStatus = [];
|
|
const REALM_GUILDS = client.REALM_GUILDS;
|
|
|
|
for (const [realm, guildId] of Object.entries(REALM_GUILDS)) {
|
|
if (!guildId) {
|
|
realmStatus.push({ name: realm.charAt(0).toUpperCase() + realm.slice(1), status: 'Not configured', members: 0 });
|
|
continue;
|
|
}
|
|
|
|
const guild = client.guilds.cache.get(guildId);
|
|
if (guild) {
|
|
realmStatus.push({ name: realm.charAt(0).toUpperCase() + realm.slice(1), status: 'Online', members: guild.memberCount });
|
|
} else {
|
|
realmStatus.push({ name: realm.charAt(0).toUpperCase() + realm.slice(1), status: 'Offline', members: 0 });
|
|
}
|
|
}
|
|
|
|
const realmFields = realmStatus.map(r => ({
|
|
name: r.name,
|
|
value: `${r.status === 'Online' ? '🟢' : r.status === 'Offline' ? '🔴' : '⚪'} ${r.status}${r.members > 0 ? ` (${r.members.toLocaleString()})` : ''}`,
|
|
inline: true,
|
|
}));
|
|
|
|
const embed = new EmbedBuilder()
|
|
.setColor(0x7c3aed)
|
|
.setTitle('AeThex Network Status')
|
|
.setDescription('Current status of the AeThex Federation')
|
|
.addFields(
|
|
{ name: 'Total Servers', value: `${guildCount}`, inline: true },
|
|
{ name: 'Total Members', value: `${memberCount.toLocaleString()}`, inline: true },
|
|
{ name: 'Uptime', value: `${hours}h ${minutes}m ${seconds}s`, inline: true },
|
|
...realmFields,
|
|
{ name: 'Sentinel Status', value: client.heatMap.size > 0 ? `⚠️ Monitoring ${client.heatMap.size} user(s)` : '🛡️ All Clear', inline: false },
|
|
{ name: 'Active Tickets', value: `${client.activeTickets.size}`, inline: true },
|
|
{ name: 'Federation Mappings', value: `${client.federationMappings.size}`, inline: true }
|
|
)
|
|
.setFooter({ text: 'AeThex Unified Bot' })
|
|
.setTimestamp();
|
|
|
|
await interaction.reply({ embeds: [embed] });
|
|
},
|
|
};
|