mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2025-09-21 06:41:35 +01:00
Some checks are pending
Docker / build (push) Waiting to run
* add simple music functionality * update workflow * update Dockerfile * update Dockerfile * update Dockerfile * update Dockerfile * add few more music commands * add lyrics command * update lyrics command * add loop, and add categories to all commands * change discord status * seperate distube and change startup console theme * Update README * UPDATE LICENSE file * fix docker compose image, add better error handling for distube and update tagging workflow * switch to node-alpine image for docker * switch to node-alpine image for docker * update ascii * music commands imporvements, implement live lyrics, some guards and bot leaving on empty * use ffmpeg package rather than ffmpeg-static
47 lines
1.6 KiB
JavaScript
47 lines
1.6 KiB
JavaScript
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName("uptime")
|
|
.setDescription("Shows how long the bot has been running"),
|
|
category: "Core",
|
|
|
|
async execute(interaction, client) {
|
|
try {
|
|
const uptime = client.uptime;
|
|
const days = Math.floor(uptime / (24 * 60 * 60 * 1000));
|
|
const hours = Math.floor(
|
|
(uptime % (24 * 60 * 60 * 1000)) / (60 * 60 * 1000)
|
|
);
|
|
const minutes = Math.floor((uptime % (60 * 60 * 1000)) / (60 * 1000));
|
|
const seconds = Math.floor((uptime % (60 * 1000)) / 1000);
|
|
const serverName = interaction.guild.name;
|
|
|
|
const uptimeEmbed = new EmbedBuilder()
|
|
.setColor("#0099ff")
|
|
.setTitle("Bot Uptime")
|
|
.setDescription(`The bot has been online for:`)
|
|
.addFields(
|
|
{ name: "Days", value: `${days}`, inline: true },
|
|
{ name: "Hours", value: `${hours}`, inline: true },
|
|
{ name: "Minutes", value: `${minutes}`, inline: true },
|
|
{ name: "Seconds", value: `${seconds}`, inline: true }
|
|
)
|
|
.setTimestamp()
|
|
.setFooter({
|
|
text: `${serverName} | Made with ❤️ by Ayden`,
|
|
iconURL: client.user.displayAvatarURL(),
|
|
});
|
|
|
|
await interaction.reply({
|
|
embeds: [uptimeEmbed],
|
|
});
|
|
} catch (error) {
|
|
console.error("Error executing the uptime command:", error);
|
|
await interaction.reply({
|
|
content: "There was an error while executing this command!",
|
|
ephemeral: true,
|
|
});
|
|
}
|
|
},
|
|
};
|