From eee954968b97b016646b0f2adc498367a2aeca00 Mon Sep 17 00:00:00 2001 From: Xargana Date: Sun, 30 Mar 2025 10:24:46 +0300 Subject: [PATCH 1/2] a --- discord/index.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/discord/index.js b/discord/index.js index 0a4c8dc..ec47402 100644 --- a/discord/index.js +++ b/discord/index.js @@ -821,18 +821,15 @@ case "anime": const maxHops = interaction.options.getInteger("hops") || 16; const { spawn } = require('child_process'); - // Use shell option to properly handle the pipe - const tracepath = spawn('traceroute -q 1 -d -m ' + maxHops + ' ' + target + ' | awk \'{print $1, $2, $3}\'', { - shell: true - }); + const tracepath = spawn('traceroute', ['-q', '1', '-d', '-m', `${maxHops}`, target]); let output = ''; tracepath.stdout.on('data', async (data) => { const newData = data.toString() - .split('\n') - .map(line => line.trim()) - .join('\n'); + .split('\n') + .map(line => line.trim()) + .join('\n'); output += newData; const traceEmbed = { From 13780eca8fe8acf8d840f5237af4a9791240e252 Mon Sep 17 00:00:00 2001 From: Xargana Date: Sun, 30 Mar 2025 10:26:19 +0300 Subject: [PATCH 2/2] a --- discord/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/discord/index.js b/discord/index.js index ec47402..e61eb5a 100644 --- a/discord/index.js +++ b/discord/index.js @@ -821,15 +821,15 @@ case "anime": const maxHops = interaction.options.getInteger("hops") || 16; const { spawn } = require('child_process'); - const tracepath = spawn('traceroute', ['-q', '1', '-d', '-m', `${maxHops}`, target]); + const tracepath = spawn('traceroute', ['-q', '1', '-d', '-m', `${maxHops}`, target, " | awk '{print $1, $2, $3}'"]); let output = ''; tracepath.stdout.on('data', async (data) => { const newData = data.toString() - .split('\n') - .map(line => line.trim()) - .join('\n'); + .split('\n') + .map(line => line.trim()) + .join('\n'); output += newData; const traceEmbed = { @@ -865,7 +865,7 @@ case "anime": ephemeral: true }); } - break; + break; case "whois": try { await interaction.deferReply();