chomens-bot-js/commands/uptime.js

22 lines
945 B
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:10:51 -05:00
const time = moment.utc(Math.floor(performance.now())).format('D [days], H [hours], m [minutes], s [seconds]')
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:10:51 -05:00
const time = moment.utc(Math.floor(performance.now())).format('D [days], H [hours], m [minutes], s [seconds]')
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] })
}
}