2022-12-24 00:59:52 -05:00
|
|
|
const { EmbedBuilder } = require('discord.js')
|
2022-12-11 01:09:38 -05:00
|
|
|
const moment = require('moment-timezone')
|
2022-08-14 05:51:45 -04:00
|
|
|
module.exports = {
|
|
|
|
name: 'uptime',
|
|
|
|
alias: [],
|
|
|
|
description: 'Shows the bot\'s uptime',
|
|
|
|
usage: '',
|
|
|
|
trusted: 0,
|
2022-12-14 08:51:30 -05:00
|
|
|
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
|
2023-01-16 04:30:00 -05:00
|
|
|
const duration = moment.duration(Math.floor(performance.now()))
|
|
|
|
const time = `${duration.days()} days, ${duration.hours()} hours, ${duration.minutes()}, minutes, ${duration.seconds()} seconds` // moment please add duration.format()
|
2022-12-11 01:09:38 -05:00
|
|
|
bot.tellraw(selector, [{ text: 'The bot\'s uptime is ', color: 'white' }, { text: time, color: 'green' }])
|
2022-10-15 00:45:40 -04:00
|
|
|
},
|
2022-12-14 08:51:30 -05:00
|
|
|
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
|
2023-01-16 04:30:00 -05:00
|
|
|
const duration = moment.duration(Math.floor(performance.now()))
|
|
|
|
const time = `${duration.days()} days, ${duration.hours()} hours, ${duration.minutes()}, minutes, ${duration.seconds()} seconds` // moment please add duration.format()
|
2022-12-24 00:59:52 -05:00
|
|
|
const Embed = new EmbedBuilder()
|
2022-12-01 05:15:30 -05:00
|
|
|
.setColor(config.discord.embedsColors.normal)
|
2022-11-27 02:35:28 -05:00
|
|
|
.setTitle('Bot\'s Uptime')
|
2022-12-11 01:09:38 -05:00
|
|
|
.setDescription(`The bot's uptime is ${time}`)
|
2022-11-27 02:35:28 -05:00
|
|
|
channeldc.send({ embeds: [Embed] })
|
|
|
|
}
|
|
|
|
}
|