From 89e50fab13818bf8294aedbc50e3374429954c77 Mon Sep 17 00:00:00 2001 From: Xargana Date: Sun, 30 Mar 2025 09:25:49 +0300 Subject: [PATCH 1/2] a --- discord/index.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/discord/index.js b/discord/index.js index 12afad3..06ac34c 100644 --- a/discord/index.js +++ b/discord/index.js @@ -821,30 +821,39 @@ case "anime": const maxHops = interaction.options.getInteger("hops") || 30; const { spawn } = require('child_process'); - const traceroute = spawn('traceroute', ['-m', maxHops, target]); + const traceroute = spawn('traceroute', ['-n', '-m', maxHops, target]); // Added -n flag for numeric output let output = ''; traceroute.stdout.on('data', async (data) => { - output += data.toString(); + // Process each line to make it more compact + const newData = data.toString() + .split('\n') + .map(line => { + // Remove extra spaces and asterisks + return line.replace(/\s+/g, ' ').replace(/\* \* \*/g, '*'); + }) + .join('\n'); + + output += newData; const traceEmbed = { - title: "Traceroute Results (Live)", - description: `Target: ${target}\nMax Hops: ${maxHops}\n\n\`\`\`\n${output}\`\`\``, + title: `📍 Trace to ${target}`, + description: `\`\`\`\n${output}\`\`\``, color: 0x3498db, timestamp: new Date(), - footer: { text: "Network Diagnostics" } + footer: { text: "🔍 Tracing..." } }; await interaction.editReply({ embeds: [traceEmbed] }); }); - traceroute.on('close', async (code) => { + traceroute.on('close', async () => { const finalEmbed = { - title: "Traceroute Complete", - description: `Target: ${target}\nMax Hops: ${maxHops}\n\n\`\`\`\n${output}\`\`\``, + title: `📍 Trace to ${target} - Complete`, + description: `\`\`\`\n${output}\`\`\``, color: 0x00ff00, timestamp: new Date(), - footer: { text: "Network Diagnostics" } + footer: { text: "✅ Trace complete" } }; await interaction.editReply({ embeds: [finalEmbed] }); @@ -856,7 +865,7 @@ case "anime": ephemeral: true }); } - break; + break; case "whois": try { await interaction.deferReply(); From 2a3f24456e5cd6bb25c12ca92975ff299e9d4b8d Mon Sep 17 00:00:00 2001 From: Xargana Date: Sun, 30 Mar 2025 09:25:57 +0300 Subject: [PATCH 2/2] a --- discord/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discord/index.js b/discord/index.js index 06ac34c..aded0da 100644 --- a/discord/index.js +++ b/discord/index.js @@ -837,11 +837,11 @@ case "anime": output += newData; const traceEmbed = { - title: `📍 Trace to ${target}`, + title: `Trace to ${target}`, description: `\`\`\`\n${output}\`\`\``, color: 0x3498db, timestamp: new Date(), - footer: { text: "🔍 Tracing..." } + footer: { text: "Tracing..." } }; await interaction.editReply({ embeds: [traceEmbed] }); @@ -849,7 +849,7 @@ case "anime": traceroute.on('close', async () => { const finalEmbed = { - title: `📍 Trace to ${target} - Complete`, + title: `Trace to ${target} - Complete`, description: `\`\`\`\n${output}\`\`\``, color: 0x00ff00, timestamp: new Date(),