de-OOPify stuff a little

This commit is contained in:
spiral 2021-10-20 12:56:51 -04:00
parent c3fa0554c4
commit 2aadc1a1ef
No known key found for this signature in database
GPG key ID: A6059F0CA0E1BD31
6 changed files with 30 additions and 89 deletions

View file

@ -81,21 +81,12 @@ const categoryPage = (cat, id, direct = false) => {
return data;
}
class Help
{
constructor() {
this.aliases = ['commands'];
this.category = CommandCategory.INFO;
this.isAllowedForContext = CommandPermission.yes;
this.description = 'Provides the list of commands';
}
/**
* @param {Message} message
* @param {Array} args
* @param {Command} Command
*/
async process(message, args, command) {
module.exports = {
aliases: ["commands"],
category: CommandCategory.INFO,
isAllowedForContext: () => true,
description: 'Provides the list of commands.',
process: async (message, args) => {
if (!args[0])
await bot.api.channels(message.channel.id).messages.post({ data: mainPage(message.author.id) });
else
@ -111,8 +102,6 @@ class Help
}
}
module.exports = new Help();
module.exports.interactionHandler = async (event) => {
const user = event.member ? event.member.user.id : event.user.id;
const customId = event.data.custom_id;