This commit is contained in:
root 2025-03-30 07:53:09 +01:00
commit 6ac0989448

View file

@ -821,7 +821,7 @@ case "anime":
const maxHops = interaction.options.getInteger("hops") || 16; const maxHops = interaction.options.getInteger("hops") || 16;
const { spawn } = require('child_process'); const { spawn } = require('child_process');
const tracepath = spawn('traceroute', ['-q 1', `-m ${maxHops}`, target, " | awk \'{print $1, $2, $3}\'"]); const tracepath = spawn('traceroute', ['-q', '1', '-d', '-m', `${maxHops}`, target, " | awk '{print $1, $2, $3}'"]);
let output = ''; let output = '';
@ -830,7 +830,7 @@ case "anime":
.split('\n') .split('\n')
.map(line => line.trim()) .map(line => line.trim())
.join('\n'); .join('\n');
output += newData; output += newData;
const traceEmbed = { const traceEmbed = {
title: `Path to ${target}`, title: `Path to ${target}`,
@ -843,6 +843,10 @@ case "anime":
await interaction.editReply({ embeds: [traceEmbed] }); await interaction.editReply({ embeds: [traceEmbed] });
}); });
tracepath.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
tracepath.on('close', async () => { tracepath.on('close', async () => {
const finalEmbed = { const finalEmbed = {
title: `Path to ${target} - Complete`, title: `Path to ${target} - Complete`,
@ -861,7 +865,7 @@ case "anime":
ephemeral: true ephemeral: true
}); });
} }
break; break;
case "whois": case "whois":
try { try {
await interaction.deferReply(); await interaction.deferReply();