chomens-bot-js/commands/uptime.js

20 lines
852 B
JavaScript
Raw Normal View History

2022-11-27 02:35:28 -05:00
const { MessageEmbed } = require('discord.js')
const { secondsToHms } = require('../util/secondToHms')
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, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
2022-11-27 02:35:28 -05:00
bot.tellraw(selector, [{ text: 'The bot\'s uptime is ', color: 'white' }, { text: `${secondsToHms(Math.floor(performance.now() / 1000))}`, color: 'green' }])
},
2022-12-01 05:15:30 -05:00
discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) {
const Embed = new MessageEmbed()
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')
.setDescription(`The bot's uptime is ${secondsToHms(Math.floor(performance.now() / 1000))}`)
channeldc.send({ embeds: [Embed] })
}
}