added es6 and common js examples for commands templates in data

This commit is contained in:
Parker2991 2024-11-06 12:21:44 -05:00
parent ca45444dd5
commit ab87e748f9
4 changed files with 41 additions and 2 deletions

View file

@ -2,6 +2,7 @@ module.exports = {
data: {
name: 'console',
trustLevel: 4,
description: "",
aliases: [
],

View file

@ -0,0 +1,19 @@
module.exports = {
data: {
name: '<command name>',
trustLevel: 0, // trust levels: 0, 1, 2, 3, 4
aliases: [
""
],
description: '',
usages: [
""
],
},
execute (context) {
},
discordExecute (context) {
}
}

View file

@ -0,0 +1,19 @@
export default {
data: {
name: '<command name>',
trustLevel: 0, // trust levels: 0, 1, 2, 3, 4
aliases: [
],
description: '',
usages: [
""
],
},
execute (context) {
},
discordExecute (context) {
}
}

View file

@ -155,8 +155,8 @@ async function command_manager (bot, options, config, discordClient) {
const filePath = path.join(commandsPath, filename);
if (filename.endsWith('.mjs')) {
let command = await import(filePath);
bot.commandManager.register(command);
bot.commandManager.commandlist.push(command);
bot.commandManager.register(command.default);
bot.commandManager.commandlist.push(command.default);
}
if (filename.endsWith('.js')) {
let command = require(filePath);