diff --git a/.replit b/.replit index edd8d3b..a8facc5 100644 --- a/.replit +++ b/.replit @@ -22,6 +22,10 @@ externalPort = 80 localPort = 8080 externalPort = 8080 +[[ports]] +localPort = 46429 +externalPort = 3000 + [workflows] runButton = "Project" diff --git a/aethex-bot/bot.js b/aethex-bot/bot.js index e991271..6c54415 100644 --- a/aethex-bot/bot.js +++ b/aethex-bot/bot.js @@ -269,182 +269,12 @@ client.on("interactionCreate", async (interaction) => { }); // ============================================================================= -// COMMANDS FOR REGISTRATION (Modified: Added Sentinel commands) +// COMMANDS FOR REGISTRATION (Uses actual command file definitions) // ============================================================================= -const COMMANDS_TO_REGISTER = [ - { - name: "verify", - description: "Link your Discord account to AeThex", - }, - { - name: "set-realm", - description: "Choose your primary arm/realm (Labs, GameForge, Corp, etc.)", - options: [ - { - name: "realm", - type: 3, - description: "Your primary realm", - required: true, - choices: [ - { name: "Labs", value: "labs" }, - { name: "GameForge", value: "gameforge" }, - { name: "Corp", value: "corp" }, - { name: "Foundation", value: "foundation" }, - { name: "Dev-Link", value: "devlink" }, - ], - }, - ], - }, - { - name: "profile", - description: "View your linked AeThex profile", - }, - { - name: "unlink", - description: "Disconnect your Discord account from AeThex", - }, - { - name: "verify-role", - description: "Check your assigned Discord roles", - }, - { - name: "help", - description: "View all AeThex bot commands and features", - }, - { - name: "stats", - description: "View your AeThex statistics and activity", - }, - { - name: "leaderboard", - description: "View the top AeThex contributors", - options: [ - { - name: "category", - type: 3, - description: "Leaderboard category", - required: false, - choices: [ - { name: "Most Active (Posts)", value: "posts" }, - { name: "Most Liked", value: "likes" }, - { name: "Top Creators", value: "creators" }, - ], - }, - ], - }, - { - name: "post", - description: "Create a post in the AeThex community feed", - options: [ - { - name: "content", - type: 3, - description: "Your post content", - required: true, - max_length: 500, - }, - { - name: "category", - type: 3, - description: "Post category", - required: false, - choices: [ - { name: "General", value: "general" }, - { name: "Project Update", value: "project_update" }, - { name: "Question", value: "question" }, - { name: "Idea", value: "idea" }, - { name: "Announcement", value: "announcement" }, - ], - }, - { - name: "image", - type: 11, - description: "Attach an image to your post", - required: false, - }, - ], - }, - { - name: "refresh-roles", - description: "Refresh your Discord roles based on your AeThex profile", - }, - // Sentinel Commands - { - name: "admin", - description: "Admin controls for bot management", - options: [ - { - name: "action", - type: 3, - description: "Admin action to perform", - required: true, - choices: [ - { name: "Status", value: "status" }, - { name: "Heat Check", value: "heat" }, - { name: "Servers", value: "servers" }, - { name: "Threats", value: "threats" }, - { name: "Federation", value: "federation" }, - ], - }, - { - name: "user", - type: 6, - description: "Target user (for heat check)", - required: false, - }, - ], - }, - { - name: "federation", - description: "Manage federation role sync", - options: [ - { - name: "action", - type: 3, - description: "Federation action", - required: true, - choices: [ - { name: "Link Role", value: "link" }, - { name: "Unlink Role", value: "unlink" }, - { name: "List Linked", value: "list" }, - ], - }, - { - name: "role", - type: 8, - description: "Role to link/unlink", - required: false, - }, - ], - }, - { - name: "status", - description: "View network status and bot information", - }, - { - name: "ticket", - description: "Create or close support tickets", - options: [ - { - name: "action", - type: 3, - description: "Ticket action", - required: true, - choices: [ - { name: "Create", value: "create" }, - { name: "Close", value: "close" }, - ], - }, - { - name: "reason", - type: 3, - description: "Reason for ticket (when creating)", - required: false, - }, - ], - }, -]; +function getCommandsToRegister() { + return Array.from(client.commands.values()).map(cmd => cmd.data.toJSON()); +} // ============================================================================= // COMMAND REGISTRATION FUNCTION @@ -456,14 +286,15 @@ async function registerDiscordCommands() { process.env.DISCORD_BOT_TOKEN, ); + const commandsToRegister = getCommandsToRegister(); console.log( - `Registering ${COMMANDS_TO_REGISTER.length} slash commands...`, + `Registering ${commandsToRegister.length} slash commands...`, ); try { const data = await rest.put( Routes.applicationCommands(process.env.DISCORD_CLIENT_ID), - { body: COMMANDS_TO_REGISTER }, + { body: commandsToRegister }, ); console.log(`Successfully registered ${data.length} slash commands`); @@ -478,7 +309,7 @@ async function registerDiscordCommands() { let successCount = 0; let skipCount = 0; - for (const command of COMMANDS_TO_REGISTER) { + for (const command of commandsToRegister) { try { const posted = await rest.post( Routes.applicationCommands(process.env.DISCORD_CLIENT_ID), @@ -690,13 +521,14 @@ http return; } + const cmds = getCommandsToRegister(); const stats = { - commands: COMMANDS_TO_REGISTER.map((cmd) => ({ + commands: cmds.map((cmd) => ({ name: cmd.name, description: cmd.description, options: cmd.options?.length || 0, })), - totalCommands: COMMANDS_TO_REGISTER.length, + totalCommands: cmds.length, }; res.writeHead(200); @@ -867,7 +699,7 @@ http

Discord Commands Registration

-

Click to register all ${COMMANDS_TO_REGISTER.length} slash commands

+

Click to register all ${client.commands.size} slash commands

Registering... please wait...
diff --git a/attached_assets/Pasted--2025-12-07-18-41-52-51-7cd3339c-User-python-can-t-open_1765158208336.txt b/attached_assets/Pasted--2025-12-07-18-41-52-51-7cd3339c-User-python-can-t-open_1765158208336.txt new file mode 100644 index 0000000..e44e214 --- /dev/null +++ b/attached_assets/Pasted--2025-12-07-18-41-52-51-7cd3339c-User-python-can-t-open_1765158208336.txt @@ -0,0 +1,129 @@ + +2025-12-07 18:41:52.51 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:41:52.52 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:02.68 +7cd3339c +System +crash loop detected +2025-12-07 18:42:26.92 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:26.92 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:32.45 +7cd3339c +System +crash loop detected +2025-12-07 18:42:37.35 +7cd3339c +System +metasidecar: loaded enterprise status from environment is_enterprise=false +2025-12-07 18:42:37.35 +7cd3339c +System +starting up user application +2025-12-07 18:42:37.42 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:37.43 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:37.53 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:37.54 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:37.60 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:37.61 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:37.76 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:37.76 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:38.47 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:38.47 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:39.01 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:39.02 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:41.64 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:41.65 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:46.04 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:46.04 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:47.19 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:47.20 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:42:47.35 +7cd3339c +System +initializing deployment without listening for application ports +2025-12-07 18:42:47.35 +7cd3339c +System +initializing deployment without listening for application ports +2025-12-07 18:42:55.20 +7cd3339c +User +python: can't open file '/home/runner/workspace/main.py': [Errno 2] No such file or directory +2025-12-07 18:42:55.20 +7cd3339c +System +command finished with error [python main.py]: exit status 2 +2025-12-07 18:43:00.79 +7cd3339c +System +crash loop detected +2025-12-07 18:43:00.79 +7cd3339c +System +crash loop detected \ No newline at end of file diff --git a/attached_assets/image_1765158225565.png b/attached_assets/image_1765158225565.png new file mode 100644 index 0000000..0d0cd05 Binary files /dev/null and b/attached_assets/image_1765158225565.png differ