mirror of
https://code.chipmunk.land/Parker2991/FridayNightFunkinBoyfriendBot.git
synced 2024-11-24 08:08:23 -05:00
added es6 and common js examples for commands templates in data
This commit is contained in:
parent
ca45444dd5
commit
ab87e748f9
4 changed files with 41 additions and 2 deletions
|
@ -2,6 +2,7 @@ module.exports = {
|
|||
data: {
|
||||
name: 'console',
|
||||
trustLevel: 4,
|
||||
description: "",
|
||||
aliases: [
|
||||
|
||||
],
|
||||
|
|
19
src/data/commonJSCommandFormat.js
Normal file
19
src/data/commonJSCommandFormat.js
Normal 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) {
|
||||
|
||||
}
|
||||
}
|
19
src/data/es6JSCommandFormat.mjs
Normal file
19
src/data/es6JSCommandFormat.mjs
Normal 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) {
|
||||
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue