chomens-bot-js/commands/uptime.js

24 lines
1.2 KiB
JavaScript
Raw Normal View History

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,
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' }])
},
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()
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] })
}
}