Merge branch 'main' of https://github.com/Xargana/blahaj-srv
This commit is contained in:
commit
aec3a7671a
|
@ -820,13 +820,16 @@ case "anime":
|
||||||
const target = interaction.options.getString("target");
|
const target = interaction.options.getString("target");
|
||||||
const maxHops = interaction.options.getInteger("hops") || 30;
|
const maxHops = interaction.options.getInteger("hops") || 30;
|
||||||
|
|
||||||
const { exec } = require('child_process');
|
const { spawn } = require('child_process');
|
||||||
exec(`tracepath -4 -m ${maxHops} ${target}`, async (error, stdout, stderr) => {
|
const traceroute = spawn('traceroute', ['-m', maxHops, target]);
|
||||||
const output = stdout || stderr || 'No response';
|
|
||||||
|
|
||||||
|
let output = '';
|
||||||
|
|
||||||
|
traceroute.stdout.on('data', async (data) => {
|
||||||
|
output += data.toString();
|
||||||
const traceEmbed = {
|
const traceEmbed = {
|
||||||
title: "Traceroute Results",
|
title: "Traceroute Results (Live)",
|
||||||
description: `Target: ${target}\nMax Hops: ${maxHops}\n\`\`\`${output}\`\`\``,
|
description: `Target: ${target}\nMax Hops: ${maxHops}\n\n\`\`\`\n${output}\`\`\``,
|
||||||
color: 0x3498db,
|
color: 0x3498db,
|
||||||
timestamp: new Date(),
|
timestamp: new Date(),
|
||||||
footer: { text: "Network Diagnostics" }
|
footer: { text: "Network Diagnostics" }
|
||||||
|
@ -834,6 +837,18 @@ case "anime":
|
||||||
|
|
||||||
await interaction.editReply({ embeds: [traceEmbed] });
|
await interaction.editReply({ embeds: [traceEmbed] });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
traceroute.on('close', async (code) => {
|
||||||
|
const finalEmbed = {
|
||||||
|
title: "Traceroute Complete",
|
||||||
|
description: `Target: ${target}\nMax Hops: ${maxHops}\n\n\`\`\`\n${output}\`\`\``,
|
||||||
|
color: 0x00ff00,
|
||||||
|
timestamp: new Date(),
|
||||||
|
footer: { text: "Network Diagnostics" }
|
||||||
|
};
|
||||||
|
|
||||||
|
await interaction.editReply({ embeds: [finalEmbed] });
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
|
@ -841,7 +856,8 @@ case "anime":
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break; case "whois":
|
break;
|
||||||
|
case "whois":
|
||||||
try {
|
try {
|
||||||
await interaction.deferReply();
|
await interaction.deferReply();
|
||||||
const domain = interaction.options.getString("domain");
|
const domain = interaction.options.getString("domain");
|
||||||
|
|
Loading…
Reference in a new issue