-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathAddonTemplate.js
71 lines (62 loc) · 2.37 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
65
66
67
68
69
70
71
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";
// Construct the addon including its name and version.
const addon = new Addon("AddonTemplate", "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);
// Declare the log message to be sent when the addon loads.
// Refer to BryanBot Docs on how to format log messages for BryanBot Console Logging
addon.setLog(`prefix{cyan{${addon.name}}} has been green{loaded}! Version: bold{${addon.version}}`);
// Declare the developer of the addon for future credit and support issues
// Declare your main alias and optionaly your Discord Invite, Document website and an o
addon.setDeveloper("BryanBot") // Developer Name (required)
.setDiscord("https://bryanbot.dev/discord") // Your discord invite link or redirect (optional)
.setDocs("https://bryanbot.dev/docs") // Documentation reguarding this addon (optional)
.setAdditional("Thank you for using BryanBot. We are happy to assist you if you have any further questions. Please check out our discord!") // Extra information for the addon (optional)
// The main function to be executed when the addon is loaded
addon.setExecute(async (manager) => {
console.log("TesT addon executed!");
// Register a new command with the BryanBot CommandHandler
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;