mirror of
https://github.com/janderedev/automod.git
synced 2024-12-22 10:45:27 +00:00
fix help command
This commit is contained in:
parent
e4a408ff30
commit
2e9570b6be
|
@ -17,8 +17,9 @@ export default {
|
||||||
name: 'ban',
|
name: 'ban',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'Ban a member from the server',
|
description: 'Ban a member from the server',
|
||||||
syntax: '/ban @username [10m?] [reason?]',
|
syntax: '/ban @username [10m|1h|...?] [reason?]',
|
||||||
removeEmptyArgs: true,
|
removeEmptyArgs: true,
|
||||||
|
category: 'moderation',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
if (!await isModerator(message.member!, message.serverContext))
|
if (!await isModerator(message.member!, message.serverContext))
|
||||||
return message.reply(NO_MANAGER_MSG);
|
return message.reply(NO_MANAGER_MSG);
|
||||||
|
|
|
@ -12,6 +12,7 @@ export default {
|
||||||
aliases: [ 'admins', 'manager', 'managers' ],
|
aliases: [ 'admins', 'manager', 'managers' ],
|
||||||
description: 'Allow users to control the bot\'s configuration',
|
description: 'Allow users to control the bot\'s configuration',
|
||||||
syntax: SYNTAX,
|
syntax: SYNTAX,
|
||||||
|
category: 'configuration',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
if (!hasPerm(message.member!, 'ManageServer'))
|
if (!hasPerm(message.member!, 'ManageServer'))
|
||||||
return message.reply('You need **ManageServer** permission to use this command.');
|
return message.reply('You need **ManageServer** permission to use this command.');
|
||||||
|
|
|
@ -12,6 +12,7 @@ export default {
|
||||||
name: 'botctl',
|
name: 'botctl',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'Perform administrative actions',
|
description: 'Perform administrative actions',
|
||||||
|
category: 'configuration',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
if (!isBotManager(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
if (!isBotManager(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,8 @@ import MessageCommandContext from "../../struct/MessageCommandContext";
|
||||||
export default {
|
export default {
|
||||||
name: 'debug',
|
name: 'debug',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'give info helpful for development and debugging',
|
description: 'Gives info helpful for development and debugging',
|
||||||
|
category: 'misc',
|
||||||
run: (message: MessageCommandContext, args: string[]) => {
|
run: (message: MessageCommandContext, args: string[]) => {
|
||||||
message.reply(`Server ID: ${message.channel?.server_id || 'None'}\n`
|
message.reply(`Server ID: ${message.channel?.server_id || 'None'}\n`
|
||||||
+ `Server context: ${message.serverContext._id} `
|
+ `Server context: ${message.serverContext._id} `
|
||||||
|
|
|
@ -9,6 +9,7 @@ export default {
|
||||||
description: 'Evaluate JS code',
|
description: 'Evaluate JS code',
|
||||||
restrict: 'BOTOWNER',
|
restrict: 'BOTOWNER',
|
||||||
removeEmptyArgs: false,
|
removeEmptyArgs: false,
|
||||||
|
category: 'owner',
|
||||||
run: async (message: Message, args: string[]) => {
|
run: async (message: Message, args: string[]) => {
|
||||||
let cmd = `let { client } = require("../..");`
|
let cmd = `let { client } = require("../..");`
|
||||||
+ `let axios = require("axios").default;`
|
+ `let axios = require("axios").default;`
|
||||||
|
|
|
@ -1,11 +1,111 @@
|
||||||
import Command from "../../struct/Command";
|
import Command from "../../struct/Command";
|
||||||
import { Message } from "revolt.js/dist/maps/Messages";
|
import { Message } from "revolt.js/dist/maps/Messages";
|
||||||
|
import { commands, DEFAULT_PREFIX, ownerIDs } from "../modules/command_handler";
|
||||||
|
import CommandCategory from "../../struct/CommandCategory";
|
||||||
|
|
||||||
|
const categories: { [key: string]: CommandCategory } = {
|
||||||
|
'moderation': {
|
||||||
|
friendlyName: 'Moderation',
|
||||||
|
description: 'Moderation-focused commands',
|
||||||
|
aliases: [ 'mod', 'mods' ],
|
||||||
|
},
|
||||||
|
'configuration': {
|
||||||
|
friendlyName: 'Configuration',
|
||||||
|
description: 'Configure AutoMod',
|
||||||
|
aliases: [ 'conf', 'config' ],
|
||||||
|
},
|
||||||
|
'misc': {
|
||||||
|
friendlyName: 'Misc',
|
||||||
|
description: 'Random stuff :yed:',
|
||||||
|
aliases: [ 'miscellaneous', 'weirdwordicantspell' ],
|
||||||
|
},
|
||||||
|
'owner': {
|
||||||
|
friendlyName: 'Owner',
|
||||||
|
description: 'Owner-only commands for managing AutoMod',
|
||||||
|
aliases: [],
|
||||||
|
},
|
||||||
|
'uncategorized': {
|
||||||
|
friendlyName: 'Uncategorized',
|
||||||
|
description: 'Uncategorized commands',
|
||||||
|
aliases: [],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'help',
|
name: 'help',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'help command i guess',
|
description: 'Help command.',
|
||||||
run: (message: Message, args: string[]) => {
|
removeEmptyArgs: true,
|
||||||
message.reply(`command list can be found here kthxbay https://github.com/janderedev/revolt-automod/wiki/Bot-usage`);
|
category: 'misc',
|
||||||
|
run: async (message: Message, args: string[]) => {
|
||||||
|
const isBotOwner = ownerIDs.includes(message.author_id);
|
||||||
|
const prefix = DEFAULT_PREFIX; // TODO: fetch prefix from server config
|
||||||
|
|
||||||
|
let searchInput = args.shift()?.toLowerCase();
|
||||||
|
if (!searchInput) {
|
||||||
|
let msg = `## AutoMod help\n` +
|
||||||
|
`Type **${prefix}help [category]** to view see all commands or **${prefix}help [command]** to learn more about a command.\n\n`;
|
||||||
|
|
||||||
|
let total = 0;
|
||||||
|
|
||||||
|
for (const categoryName in categories) {
|
||||||
|
let cmdCount = commands.filter(
|
||||||
|
cmd => ((cmd.category || 'uncategorized') == categoryName) &&
|
||||||
|
(cmd.restrict == 'BOTOWNER' ? isBotOwner : true) // Ensure owner commands are only shown to bot owner
|
||||||
|
).length;
|
||||||
|
|
||||||
|
if (cmdCount > 0) {
|
||||||
|
total++;
|
||||||
|
const category = categories[categoryName];
|
||||||
|
msg += `**${category.friendlyName}**\n` +
|
||||||
|
` \u200b \u200b ↳ ${(category.description)} \u200b $\\big |$ \u200b **${cmdCount}** command${cmdCount == 1 ? '' : 's'}\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
msg += `\n##### Categories: ${total}`;
|
||||||
|
|
||||||
|
await message.reply(msg);
|
||||||
|
} else {
|
||||||
|
let [ categoryName, category ] = Object.entries(categories).find(
|
||||||
|
c => c[1].friendlyName.toLowerCase() == searchInput
|
||||||
|
|| c[0].toLowerCase() == searchInput
|
||||||
|
) || Object.entries(categories).find(
|
||||||
|
c => c[1].aliases.find(k => k.toLowerCase() == searchInput)
|
||||||
|
) || [];
|
||||||
|
if (category && !searchInput.startsWith(prefix)) {
|
||||||
|
let msg = `**AutoMod help** - Category: ${category.friendlyName}\n`
|
||||||
|
+ `${category.description}\n\n`
|
||||||
|
+ `Type **${prefix}help [command]** to learn more about a command.\n\n`;
|
||||||
|
|
||||||
|
let cmdList = commands.filter(c => (c.category || 'uncategorized') == categoryName);
|
||||||
|
if (cmdList.length > 0) {
|
||||||
|
for (const cmd of cmdList) {
|
||||||
|
msg += `**${prefix}${cmd.name}** \u200b $\\big |$ \u200b ${cmd.description}\n`;
|
||||||
|
|
||||||
|
msg += '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
msg += `##### Total: ${cmdList.length}`;
|
||||||
|
} else msg += `### This category is empty.`;
|
||||||
|
|
||||||
|
await message.reply(msg);
|
||||||
|
} else {
|
||||||
|
if (searchInput.startsWith(prefix)) searchInput = searchInput.substring(prefix.length);
|
||||||
|
let cmd = commands.find(c => c.name.toLowerCase() == searchInput)
|
||||||
|
|| commands.find(c => c.aliases && c.aliases.find(k => k.toLowerCase() == searchInput));
|
||||||
|
|
||||||
|
if (!cmd) {
|
||||||
|
return message.reply(`I can't find any command or category matching \`${searchInput}\`.`);
|
||||||
|
} else {
|
||||||
|
let msg = `**AutoMod help** - Command: ${cmd.name}\n`
|
||||||
|
+ `${cmd.description}\n\n`;
|
||||||
|
|
||||||
|
if (cmd.syntax) msg += `Syntax: \`${cmd.syntax}\`\n`;
|
||||||
|
msg += 'Aliases: ' + (cmd.aliases ? `\`${cmd.aliases.join(`\`, \``)}\`` : 'None') + '\n';
|
||||||
|
|
||||||
|
message.reply(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} as Command;
|
} as Command;
|
||||||
|
|
|
@ -14,6 +14,7 @@ export default {
|
||||||
description: 'Eject a member from the server',
|
description: 'Eject a member from the server',
|
||||||
syntax: '/kick @username [reason?]',
|
syntax: '/kick @username [reason?]',
|
||||||
removeEmptyArgs: true,
|
removeEmptyArgs: true,
|
||||||
|
category: 'moderation',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
if (!await isModerator(message.member!, message.serverContext))
|
if (!await isModerator(message.member!, message.serverContext))
|
||||||
return message.reply(NO_MANAGER_MSG);
|
return message.reply(NO_MANAGER_MSG);
|
||||||
|
|
|
@ -15,6 +15,7 @@ export default {
|
||||||
aliases: [ 'moderators', 'mod', 'mods' ],
|
aliases: [ 'moderators', 'mod', 'mods' ],
|
||||||
description: 'Allow users to moderate other users',
|
description: 'Allow users to moderate other users',
|
||||||
syntax: SYNTAX,
|
syntax: SYNTAX,
|
||||||
|
category: 'configuration',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
if (!await isBotManager(message.member!, message.channel?.server!)) return message.reply(NO_MANAGER_MSG);
|
if (!await isBotManager(message.member!, message.channel?.server!)) return message.reply(NO_MANAGER_MSG);
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
||||||
name: 'ping',
|
name: 'ping',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'ping pong',
|
description: 'ping pong',
|
||||||
|
category: 'misc',
|
||||||
run: async (message: Message, args: string[]) => {
|
run: async (message: Message, args: string[]) => {
|
||||||
let now = Date.now();
|
let now = Date.now();
|
||||||
message.reply(`Measuring...`)
|
message.reply(`Measuring...`)
|
||||||
|
|
|
@ -11,8 +11,9 @@ const MENTION_TEXT = 'You can also @mention me instead of using the prefix.';
|
||||||
export default {
|
export default {
|
||||||
name: 'prefix',
|
name: 'prefix',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'modify prefix',
|
description: 'Configure AutoMod\'s prefix',
|
||||||
syntax: SYNTAX,
|
syntax: SYNTAX,
|
||||||
|
category: 'configuration',
|
||||||
run: async (message: Message, args: string[]) => {
|
run: async (message: Message, args: string[]) => {
|
||||||
let config: ServerConfig = (await client.db.get('servers').findOne({ id: message.channel?.server_id })) ?? {};
|
let config: ServerConfig = (await client.db.get('servers').findOne({ id: message.channel?.server_id })) ?? {};
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,9 @@ const MAX_PURGE_AMOUNT = 100;
|
||||||
export default {
|
export default {
|
||||||
name: 'purge',
|
name: 'purge',
|
||||||
aliases: [ 'clear' ],
|
aliases: [ 'clear' ],
|
||||||
description: 'delete multiple messages at once',
|
description: 'Mass delete messages',
|
||||||
syntax: SYNTAX,
|
syntax: SYNTAX,
|
||||||
|
category: 'moderation',
|
||||||
run: async (message: Message, args: string[]) => {
|
run: async (message: Message, args: string[]) => {
|
||||||
try {
|
try {
|
||||||
if (!message.member || !await isModerator(message.member!, message.channel?.server!)) return message.reply('🔒 Access denied');
|
if (!message.member || !await isModerator(message.member!, message.channel?.server!)) return message.reply('🔒 Access denied');
|
||||||
|
|
|
@ -11,11 +11,12 @@ import MessageCommandContext from "../../struct/MessageCommandContext";
|
||||||
export default {
|
export default {
|
||||||
name: 'settings',
|
name: 'settings',
|
||||||
aliases: [ 'setting' ],
|
aliases: [ 'setting' ],
|
||||||
description: 'change antispam settings',
|
description: 'Manage AutoMod\'s configuration',
|
||||||
|
category: 'configuration',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
if (!isBotManager(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
if (!isBotManager(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
||||||
|
|
||||||
return 'command is disabled for now';
|
return 'This feature is currently disabled';
|
||||||
|
|
||||||
let settings = {
|
let settings = {
|
||||||
spam: [
|
spam: [
|
||||||
|
|
|
@ -8,6 +8,7 @@ export default {
|
||||||
description: 'Run code in a shell',
|
description: 'Run code in a shell',
|
||||||
restrict: 'BOTOWNER',
|
restrict: 'BOTOWNER',
|
||||||
removeEmptyArgs: false,
|
removeEmptyArgs: false,
|
||||||
|
category: 'owner',
|
||||||
run: async (message: Message, args: string[]) => {
|
run: async (message: Message, args: string[]) => {
|
||||||
let cmd = args.join(' ');
|
let cmd = args.join(' ');
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,9 @@ import { Message } from "revolt.js/dist/maps/Messages";
|
||||||
export default {
|
export default {
|
||||||
name: 'test',
|
name: 'test',
|
||||||
aliases: [ 'testalias' ],
|
aliases: [ 'testalias' ],
|
||||||
description: 'epic test command',
|
description: 'Test command',
|
||||||
|
category: 'misc',
|
||||||
run: (message: Message, args: string[]) => {
|
run: (message: Message, args: string[]) => {
|
||||||
message.reply('I am here');
|
message.reply('Beep boop.');
|
||||||
}
|
}
|
||||||
} as Command;
|
} as Command;
|
||||||
|
|
|
@ -11,6 +11,7 @@ export default {
|
||||||
aliases: [ 'pardon' ],
|
aliases: [ 'pardon' ],
|
||||||
description: 'Unbans a user',
|
description: 'Unbans a user',
|
||||||
syntax: '/unban [@user or ID]',
|
syntax: '/unban [@user or ID]',
|
||||||
|
category: 'moderation',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
if (!isModerator(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
if (!isModerator(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ export default {
|
||||||
aliases: null,
|
aliases: null,
|
||||||
removeEmptyArgs: false,
|
removeEmptyArgs: false,
|
||||||
description: 'add an infraction to an user\'s record',
|
description: 'add an infraction to an user\'s record',
|
||||||
|
category: 'moderation',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
if (!await isModerator(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
if (!await isModerator(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
||||||
let user = await parseUserOrId(args.shift() ?? '');
|
let user = await parseUserOrId(args.shift() ?? '');
|
||||||
|
|
|
@ -16,6 +16,7 @@ export default {
|
||||||
aliases: [ 'warnings', 'infractions', 'infraction' ],
|
aliases: [ 'warnings', 'infractions', 'infraction' ],
|
||||||
description: 'Show all user infractions',
|
description: 'Show all user infractions',
|
||||||
syntax: '/warns; /warns @username ["export-csv"]; /warns rm [ID]',
|
syntax: '/warns; /warns @username ["export-csv"]; /warns rm [ID]',
|
||||||
|
category: 'moderation',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
if (!await isModerator(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
if (!await isModerator(message.member!, message.serverContext)) return message.reply(NO_MANAGER_MSG);
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,14 @@ import MessageCommandContext from "../../struct/MessageCommandContext";
|
||||||
import ServerConfig from "../../struct/ServerConfig";
|
import ServerConfig from "../../struct/ServerConfig";
|
||||||
import { isBotManager, NO_MANAGER_MSG, parseUser } from "../util";
|
import { isBotManager, NO_MANAGER_MSG, parseUser } from "../util";
|
||||||
|
|
||||||
const SYNTAX = '';
|
const SYNTAX = '/whitelist add @user; /whitelist remove @user; /whitelist list';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'whitelist',
|
name: 'whitelist',
|
||||||
aliases: [],
|
aliases: [],
|
||||||
description: 'Allow users or roles to bypass moderation rules',
|
description: 'Allow users or roles to bypass moderation rules',
|
||||||
syntax: SYNTAX,
|
syntax: SYNTAX,
|
||||||
|
category: 'configuration',
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
let config: ServerConfig = await client.db.get('servers').findOne({ id: message.serverContext._id }) || {}
|
let config: ServerConfig = await client.db.get('servers').findOne({ id: message.serverContext._id }) || {}
|
||||||
if (!config.whitelist) config.whitelist = { users: [], roles: [], managers: true }
|
if (!config.whitelist) config.whitelist = { users: [], roles: [], managers: true }
|
||||||
|
|
|
@ -13,13 +13,16 @@ import { fileURLToPath } from 'url';
|
||||||
const filename = fileURLToPath(import.meta.url);
|
const filename = fileURLToPath(import.meta.url);
|
||||||
const dirname = path.dirname(filename);
|
const dirname = path.dirname(filename);
|
||||||
|
|
||||||
|
const ownerIDs = process.env['BOT_OWNERS'] ? process.env['BOT_OWNERS'].split(',') : [];
|
||||||
const DEFAULT_PREFIX = process.env['PREFIX']
|
const DEFAULT_PREFIX = process.env['PREFIX']
|
||||||
?? process.env['BOT_PREFIX']
|
?? process.env['BOT_PREFIX']
|
||||||
?? process.env['COMMAND_PREFIX']
|
?? process.env['COMMAND_PREFIX']
|
||||||
?? '/';
|
?? '/';
|
||||||
|
|
||||||
|
let commands: Command[];
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
let commands: Command[] = (await Promise.all(
|
commands = (await Promise.all(
|
||||||
fs.readdirSync(path.join(dirname, '..', 'commands'))
|
fs.readdirSync(path.join(dirname, '..', 'commands'))
|
||||||
.filter(file => file.endsWith('.js'))
|
.filter(file => file.endsWith('.js'))
|
||||||
.map(async file => await import(path.join(dirname, '..', 'commands', file)) as Command)
|
.map(async file => await import(path.join(dirname, '..', 'commands', file)) as Command)
|
||||||
|
@ -43,10 +46,10 @@ const DEFAULT_PREFIX = process.env['PREFIX']
|
||||||
let guildPrefix = config.prefix ?? DEFAULT_PREFIX;
|
let guildPrefix = config.prefix ?? DEFAULT_PREFIX;
|
||||||
|
|
||||||
if (cmdName.startsWith(`<@${client.user?._id}>`)) {
|
if (cmdName.startsWith(`<@${client.user?._id}>`)) {
|
||||||
cmdName = cmdName.substr(`<@${client.user?._id}>`.length);
|
cmdName = cmdName.substring(`<@${client.user?._id}>`.length);
|
||||||
if (!cmdName) cmdName = args.shift() ?? ''; // Space between mention and command name
|
if (!cmdName) cmdName = args.shift() ?? ''; // Space between mention and command name
|
||||||
} else if (cmdName.startsWith(guildPrefix)) {
|
} else if (cmdName.startsWith(guildPrefix)) {
|
||||||
cmdName = cmdName.substr(guildPrefix.length);
|
cmdName = cmdName.substring(guildPrefix.length);
|
||||||
if (config.spaceAfterPrefix && !cmdName) cmdName = args.shift() ?? '';
|
if (config.spaceAfterPrefix && !cmdName) cmdName = args.shift() ?? '';
|
||||||
} else return;
|
} else return;
|
||||||
|
|
||||||
|
@ -55,7 +58,6 @@ const DEFAULT_PREFIX = process.env['PREFIX']
|
||||||
let cmd = commands.find(c => c.name == cmdName || (c.aliases?.indexOf(cmdName!) ?? -1) > -1);
|
let cmd = commands.find(c => c.name == cmdName || (c.aliases?.indexOf(cmdName!) ?? -1) > -1);
|
||||||
if (!cmd) return;
|
if (!cmd) return;
|
||||||
|
|
||||||
let ownerIDs = process.env['BOT_OWNERS'] ? process.env['BOT_OWNERS'].split(',') : [];
|
|
||||||
if (cmd.restrict == 'BOTOWNER' && ownerIDs.indexOf(msg.author_id) == -1) {
|
if (cmd.restrict == 'BOTOWNER' && ownerIDs.indexOf(msg.author_id) == -1) {
|
||||||
logger.warn(`User ${msg.author?.username} tried to run owner-only command: ${cmdName}`);
|
logger.warn(`User ${msg.author?.username} tried to run owner-only command: ${cmdName}`);
|
||||||
msg.reply('🔒 Access denied');
|
msg.reply('🔒 Access denied');
|
||||||
|
@ -95,4 +97,4 @@ const DEFAULT_PREFIX = process.env['PREFIX']
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
export { DEFAULT_PREFIX }
|
export { DEFAULT_PREFIX, commands, ownerIDs }
|
||||||
|
|
|
@ -6,6 +6,7 @@ class Command {
|
||||||
restrict?: 'BOTOWNER' | null;
|
restrict?: 'BOTOWNER' | null;
|
||||||
removeEmptyArgs?: boolean | null;
|
removeEmptyArgs?: boolean | null;
|
||||||
run: Function;
|
run: Function;
|
||||||
|
category?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Command;
|
export default Command;
|
||||||
|
|
7
src/struct/CommandCategory.ts
Normal file
7
src/struct/CommandCategory.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
class CommandCategory {
|
||||||
|
friendlyName: string;
|
||||||
|
description: string;
|
||||||
|
aliases: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CommandCategory;
|
Loading…
Reference in a new issue