|
| 1 | +const Discord = require("discord.js"), ms = require("ms"), |
| 2 | + Utils = require("../../Modules/Utils"), |
| 3 | + { lang, config, commands } = require("../../index"); |
| 4 | + |
| 5 | + |
| 6 | +module.exports = { |
| 7 | + name: "uptime", |
| 8 | + type: "general", |
| 9 | + commandData: commands.General.Uptime, |
| 10 | +}; |
| 11 | + |
| 12 | +/** |
| 13 | + * |
| 14 | + * @param {Discord.Client} bot |
| 15 | + * @param {Discord.Message} message |
| 16 | + * @param {Array} args |
| 17 | + * @param {Object} config |
| 18 | + */ |
| 19 | +module.exports.run = async (bot, message, args, config) => { |
| 20 | + message.reply(Utils.setupMessage({ |
| 21 | + configPath: lang.General.Uptime, |
| 22 | + variables: [ |
| 23 | + ...Utils.userVariables(message.member), |
| 24 | + ...Utils.botVariables(bot), |
| 25 | + { searchFor: /{uptime}/g, replaceWith: ms(bot.uptime, { long: true }) }, |
| 26 | + ], |
| 27 | + })); |
| 28 | +}; |
| 29 | + |
| 30 | +/** |
| 31 | + * |
| 32 | + * @param {Discord.Client} bot |
| 33 | + * @param {Discord.Interaction} interaction |
| 34 | + */ |
| 35 | +module.exports.runSlash = async (bot, interaction) => { |
| 36 | + interaction.reply(Utils.setupMessage({ |
| 37 | + configPath: lang.General.Uptime, |
| 38 | + variables: [ |
| 39 | + ...Utils.userVariables(interaction.member), |
| 40 | + ...Utils.botVariables(bot), |
| 41 | + { searchFor: /{uptime}/g, replaceWith: ms(bot.uptime, { long: true }) }, |
| 42 | + ], |
| 43 | + })); |
| 44 | +}; |
0 commit comments