From f6ef67957daa852cd527bb33f23e61f2c2e223dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 1 Apr 2020 17:32:47 +0300 Subject: [PATCH] Prepared maintenance command --- commands/maintenance.js | 35 +++++++++++++++++++++++++++++++++++ struct/messages.js | 4 +++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 commands/maintenance.js diff --git a/commands/maintenance.js b/commands/maintenance.js new file mode 100644 index 0000000..0cdd156 --- /dev/null +++ b/commands/maintenance.js @@ -0,0 +1,35 @@ +module.exports = { + name: 'maintenance', + alias: 'm', + usage: '', + description: 'Bot Maintenance', + permission: 'none', + category: 'maintenance', + execute(msg, args, client, Discord, command) { + const embed = new Discord.MessageEmbed() + .setTitle(client.messages.maintenanceTitle) + .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["maintenance"].replace(/[^0-9]+/g, '')) + .setColor(client.config.embedColor) + .setDescription(client.messages.maintenanceDescription) + .setFooter('EximiaBots by Warén Media', "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); + return msg.channel.send(embed); + } +}; + +function msToTime(duration, format) { + var seconds = Math.floor((duration / 1000) % 60), + minutes = Math.floor((duration / (1000 * 60)) % 60), + hours = Math.floor((duration / (1000 * 60 * 60)) % 24); + days = Math.floor((duration / (1000 * 60 * 60 * 24)) % 24); + + days = (days < 10) ? "0" + days : days; + hours = (hours < 10) ? "0" + hours : hours; + minutes = (minutes < 10) ? "0" + minutes : minutes; + seconds = (seconds < 10) ? "0" + seconds : seconds; + + if (format === "hh:mm:ss") { + return `${hours}:${minutes}:${seconds}`; + } else if (format === "dd:hh:mm:ss") { + return `${days}:${hours}:${minutes}:${seconds}`; + } +} \ No newline at end of file diff --git a/struct/messages.js b/struct/messages.js index 3eeed40..5ba3203 100644 --- a/struct/messages.js +++ b/struct/messages.js @@ -29,5 +29,7 @@ module.exports = { invalidVolume: "You need to enter a valid __number__.", negativeVolume: "The volume needs to be a positive number!", newVolume: "Volume is now: **%volume%**", - statisticsTitle: "Statistics" + statisticsTitle: "Statistics", + maintenanceTitle: "Maintenance", + maintenanceDescription: "This command is not ready to be used by anyone." }; \ No newline at end of file