a
This commit is contained in:
parent
e0a1aec73e
commit
7b186d8889
|
@ -396,7 +396,7 @@ client.once("ready", async () => {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
footer: {
|
footer: {
|
||||||
text: "blahaj-srv"
|
text: "blahaj.tr"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -442,13 +442,28 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await interaction.editReply({ content: `Ping: ${pingResult.time}ms` });
|
const pingEmbed = {
|
||||||
|
title: "Ping Results",
|
||||||
|
description: `Results for IP: ${ip}`,
|
||||||
|
color: 0x00ff00,
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "Response Time",
|
||||||
|
value: `${pingResult.time}ms`,
|
||||||
|
inline: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
timestamp: new Date(),
|
||||||
|
footer: {
|
||||||
|
text: "Ping Command"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
await interaction.editReply({ embeds: [pingEmbed] });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await interaction.editReply({ content: "Failed to ping.", ephemeral: true });
|
await interaction.editReply({ content: "Failed to ping.", ephemeral: true });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "server_status":
|
case "server_status":
|
||||||
try {
|
try {
|
||||||
const response = await axios.get("https://blahaj.tr:2589/status");
|
const response = await axios.get("https://blahaj.tr:2589/status");
|
||||||
|
@ -460,19 +475,34 @@ client.on("interactionCreate", async (interaction) => {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
let formattedResponse = "";
|
let formattedResponse = "";
|
||||||
|
const fields = [];
|
||||||
for (const [server, data] of Object.entries(response.data)) {
|
for (const [server, data] of Object.entries(response.data)) {
|
||||||
const status = data.online ? "online" : "offline";
|
const status = data.online ? "🟢 Online" : "🔴 Offline";
|
||||||
const responseTime = data.responseTime.toFixed(2);
|
const responseTime = data.responseTime.toFixed(2);
|
||||||
formattedResponse += `${server}: ${status}, response time: ${responseTime}ms\n`;
|
fields.push({
|
||||||
|
name: server,
|
||||||
|
value: `Status: ${status}\nResponse Time: ${responseTime}ms`,
|
||||||
|
inline: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
await interaction.reply({ content: formattedResponse });
|
|
||||||
|
const statusEmbed = {
|
||||||
|
title: "Server Status",
|
||||||
|
color: 0x00ff00,
|
||||||
|
fields: fields,
|
||||||
|
timestamp: new Date(),
|
||||||
|
footer: {
|
||||||
|
text: "Server Status Command"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
await interaction.reply({ embeds: [statusEmbed] });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await interaction.reply({ content: "Failed to get status.", ephemeral: true });
|
await interaction.reply({ content: "Failed to get status.", ephemeral: true });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "cody":
|
case "cody":
|
||||||
try {
|
try {
|
||||||
await interaction.deferReply();
|
await interaction.deferReply();
|
||||||
|
@ -796,7 +826,7 @@ case "anime":
|
||||||
|
|
||||||
const traceEmbed = {
|
const traceEmbed = {
|
||||||
title: "Traceroute Results",
|
title: "Traceroute Results",
|
||||||
description: `Target: ${target}\nMax Hops: ${maxHops}\n\n\`\`\`\n${output}\`\`\``,
|
description: `Target: ${target}\nMax Hops: ${maxHops}\n\`\`\`${output}\`\`\``,
|
||||||
color: 0x3498db,
|
color: 0x3498db,
|
||||||
timestamp: new Date(),
|
timestamp: new Date(),
|
||||||
footer: { text: "Network Diagnostics" }
|
footer: { text: "Network Diagnostics" }
|
||||||
|
@ -811,8 +841,7 @@ case "anime":
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break; case "whois":
|
||||||
case "whois":
|
|
||||||
try {
|
try {
|
||||||
await interaction.deferReply();
|
await interaction.deferReply();
|
||||||
const domain = interaction.options.getString("domain");
|
const domain = interaction.options.getString("domain");
|
||||||
|
@ -960,7 +989,7 @@ case "anime":
|
||||||
inline: true
|
inline: true
|
||||||
})),
|
})),
|
||||||
timestamp: new Date(),
|
timestamp: new Date(),
|
||||||
footer: { text: "Network Security Scanner" }
|
footer: { text: "Port Check" }
|
||||||
};
|
};
|
||||||
|
|
||||||
await interaction.editReply({ embeds: [scanEmbed] });
|
await interaction.editReply({ embeds: [scanEmbed] });
|
||||||
|
|
Loading…
Reference in a new issue