Skip to content

Commit

Permalink
added uptime feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikecerc committed Nov 27, 2021
1 parent 883242d commit db0d331
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Commands/moderator utilities/uptimeCall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { MessageEmbed } = require("discord.js");
const fs = require("fs");
module.exports = {
name: "uptime",
description: "Display's the amount of time P-CEP Utilities has been online",
execute(interaction) {
let uptimeSeconds = process.uptime();
let hours = Math.floor(uptimeSeconds / (60 * 60));
let minutes = Math.floor((uptimeSeconds % (60 * 60)) / 60);
let seconds = Math.floor(uptimeSeconds % 60);
let day = Math.floor(hours / 24);
if (hours >= 24) {
hours = hours - 24;
}

let embed = new MessageEmbed()
.setColor('RANDOM')
.setTitle('Uptime:')
.setDescription(`${day} days, ${hours} hours, ${minutes} minutes, ${seconds} seconds`);

interaction.followUp({ embeds: [embed] });
},
};

0 comments on commit db0d331

Please sign in to comment.