-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathtemplate.js
More file actions
89 lines (78 loc) · 2.6 KB
/
template.js
File metadata and controls
89 lines (78 loc) · 2.6 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Add-on template for Showdown-ChatBot
// ------------------------------------
// You can use this file as a template to develop your add-on
// This template includes all the available options,
// make sure to delete what you do not need before installation
'use strict';
/* Add here all tools you need (https://github.com/AgustinSRG/Showdown-ChatBot/wiki/Basic-Development-Guide#tools) */
const Text = Tools('text'); // eslint-disable-line no-unused-vars
/* Setup function: Called on add-on installation */
exports.setup = function (App) {
return Tools('add-on').forApp(App).install({
/* Add-on Commands (https://github.com/AgustinSRG/Showdown-ChatBot/wiki/Basic-Development-Guide#commands) */
commandsOverwrite: true,
commands: {
"examplealias": "examplecommand",
"examplecommand": function () {
this.reply("Hello world!");
},
},
/* Commands permissions */
commandPermissionsOverwrite: true,
commandPermissions: {
/**
* Groups: user, voice, driver, mod, owner, admin
* You can also use symbols: +, %, @, #, &
* For only excepted users, use: {excepted: true}
*/
"examplepermission": { group: 'mod' },
},
/* Command triggers */
commandTriggersOverwrite: true,
commandTriggers: {
/* Triggers called before running the command */
before: {
"exampletriggerbefore": function (context) {
/* If this function returns true, the command is not executed */
},
},
/* Triggers called after running the command */
after: {
"exampletriggerafter": function (context) {
// Do stuff
},
},
},
/* Bot events (https://github.com/AgustinSRG/Showdown-ChatBot/wiki/Basic-Development-Guide#bot-events) */
events: {
"connect": function () {
console.log("Bot connected to the server!");
},
},
/* Control panel options (https://github.com/AgustinSRG/Showdown-ChatBot/wiki/Basic-Development-Guide#server-handlers) */
serverHandlersOverwrite: false,
serverHandlers: {
"example": function (context, parts) {
context.endWithWebPage("<h2>Hello world!</h2>", { title: "Example" });
},
},
/* Control panel permissions */
serverPermissionsOverwrite: false,
serverPermissions: {
"example": "Permission description",
},
/* Control panel menu */
serverMenuOptionsOverwrite: false,
serverMenuOptions: {
"example": { name: "Example", url: "/example/", permission: "example", level: -1 },
},
/* Custom install script (Called on add-on installation) */
customInstall: function () {
// Do stuff
},
/* Custom uninstall script (Called on add-on removal) */
customUninstall: function () {
// Do stuff
},
});
};