mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 14:38:49 +00:00
59 lines
2.1 KiB
JavaScript
59 lines
2.1 KiB
JavaScript
const { SlashCommandBuilder } = require('@discordjs/builders');
|
|
const { EmbedBuilder } = require('discord.js');
|
|
const {
|
|
embedColors,
|
|
systemServerGuildId,
|
|
botOwnerClientId
|
|
} = require('../config.json');
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('status')
|
|
.setDescription('Show bot status.'),
|
|
run: async ({ interaction, client }) => {
|
|
if (
|
|
interaction.guildId !== systemServerGuildId ||
|
|
interaction.user.id !== botOwnerClientId
|
|
) {
|
|
return await interaction.editReply({
|
|
embeds: [
|
|
new EmbedBuilder()
|
|
.setDescription(
|
|
`**No permission**\nYou do not have permission to use this command.`
|
|
)
|
|
.setColor(embedColors.colorError)
|
|
]
|
|
});
|
|
}
|
|
|
|
let uptimeInSeconds = process.uptime();
|
|
let uptimeDate = new Date(0);
|
|
uptimeDate.setSeconds(uptimeInSeconds.toFixed(0));
|
|
let uptimeString = uptimeDate.toISOString().substring(11, 19);
|
|
|
|
return await interaction.editReply({
|
|
embeds: [
|
|
new EmbedBuilder()
|
|
.setDescription(
|
|
`**Bot Status**\n` +
|
|
`Uptime: \`${uptimeString}\`\n` +
|
|
`Memory Usage: \`${(
|
|
process.memoryUsage().heapUsed /
|
|
1024 /
|
|
1024
|
|
).toFixed(2)} MB\`\n` +
|
|
`Node Version: \`${process.version}\`\n` +
|
|
`Discord.js Version: \`v${
|
|
require('discord.js').version
|
|
}\`\n` +
|
|
`Discord Player Version: \`v${
|
|
require('discord-player').version
|
|
}\`\n` +
|
|
`Joined guilds: \`${client.guilds.cache.size}\``
|
|
)
|
|
.setColor(embedColors.colorInfo)
|
|
]
|
|
});
|
|
}
|
|
};
|