-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
AddonTemplate.js
64 lines (58 loc) · 1.57 KB
/
AddonTemplate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Command } from "../../src/Modules/Structures/Handlers/Commands.js";
import { Addon } from "../../src/Modules/Structures/Handlers/Addons.js";
import Utils from "../../src/Modules/Utils.js";
import chalk from "chalk";
const addon = new Addon("test", "v1.1.1"),
addonConfig = {
config: {
test: true,
},
lang: {
test: true,
},
commands: {
Test: {
Enabled: true,
Name: "test",
Usage: "test",
Cooldown: 0,
Permission: ["@everyone"],
Description: "This is a test command",
DeleteCommand: false,
Arguments: [],
},
},
};
/** @type {addonConfig} */
const { config, lang, commands } = addon.customConfig(addonConfig);
addon.setLog(
chalk.hex("#f52486").bold("[") +
chalk.hex("#e01e37").bold("BryanBot") +
chalk.hex("#f52486").bold("]"),
chalk.bold("TesT"),
"has been loaded!",
`Version: ${chalk.bold(`v1.1.1`)}`
);
addon.setExecute(async (manager) => {
console.log("TesT addon executed!");
new Command({
commandData: commands.Test,
commandConfig: {
guildOnly: true,
dmOnly: false,
// these are the discord permissions that the bot and user need to run the command
// not roles
requiredPermissions: {
bot: [],
user: [],
},
},
LegacyRun(manager, message, args, prefixUsed, commandData) {
message.channel.send("This is a test command!");
},
InteractionRun(manager, interaction, commandData) {
interaction.reply("This is a test command!");
},
});
});
export default addon;