Discord-Bot/src/commands/bot/uptime.js
2022-05-11 16:17:08 +02:00

28 lines
No EOL
826 B
JavaScript

const Discord = require('discord.js');
const moment = require("moment");
require("moment-duration-format");
module.exports = async (client, interaction, args) => {
const duration = moment.duration(client.uptime).format("\`D\` [days], \`H\` [hrs], \`m\` [mins], \`s\` [secs]");
const upvalue = (Date.now() / 1000 - client.uptime / 1000).toFixed(0);
client.embed({
title: `${client.emotes.normal.arrowUp}・Uptime`,
desc: `See the uptime of Bot`,
fields: [
{
name: "⌛┇Uptime",
value: `${duration}`,
inline: true
},
{
name: "⏰┇Up Since",
value: `<t:${upvalue}>`,
inline: true
}
],
type: 'editreply'
}, interaction)
}