Split commands into subdirectories
* Move command files into directories * Edit relative paths * Update gitignore * Finish support for commands in subdir * Split up getCommandFiles into own function * Add support for subdirs on help command
This commit is contained in:
parent
8993eeaf7a
commit
e7cdd425d1
21 changed files with 55 additions and 35 deletions
31
commands/info/uptime.js
Normal file
31
commands/info/uptime.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
const parseMS = require('parse-ms')
|
||||
|
||||
module.exports = {
|
||||
name: 'uptime',
|
||||
description: 'Returns uptime',
|
||||
execute({message, client}) {
|
||||
|
||||
let days = "";
|
||||
let hours = "";
|
||||
let minutes = "";
|
||||
let seconds = "";
|
||||
let milliseconds = "";
|
||||
|
||||
let uptime = parseMS(client.uptime)
|
||||
|
||||
if (uptime.days != 0)
|
||||
days = `${uptime.days} days, `
|
||||
if (uptime.hours != 0)
|
||||
hours = `${uptime.hours} hours, `
|
||||
if (uptime.minutes != 0)
|
||||
minutes = `${uptime.minutes} minutes, `
|
||||
if (uptime.seconds != 0)
|
||||
seconds = `${uptime.seconds} seconds `
|
||||
if (uptime.milliseconds != 0)
|
||||
milliseconds = `and ${uptime.milliseconds} milliseconds`
|
||||
|
||||
let fullUptime = `This bot has an uptime of ${days}${hours}${minutes}${seconds}${milliseconds}`
|
||||
|
||||
message.channel.send(fullUptime)
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue