You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,28 @@
2
2
3
3
This changelog contains mostly API-Changes and changes for developers.
4
4
5
+
## v3.0.0
6
+
7
+
* Dropped support for message commands
8
+
* Module-Database-Models now always get loaded, even if module is not enabled (this allows to enable/disable modules on the fly)
9
+
* Database-Models can not be nested (because no one did that)
10
+
* CLI-Commands, Application-Commands, Events and other relevant data will now always get loaded, even if the module is
11
+
not enabled (this allows to enable/disable modules on the fly)
12
+
* Every time an event or CLI-Command gets executed, the bot will check if that module is enabled and will return if not
13
+
* Every time application commands need to get synced, the bot will check if the corresponding module is enabled.
14
+
[To ensure the safe performance of all authorized activities](https://soundcloud.com/gamequotes/glados-to-ensure-the-safe), this check will also get executed when a command gets executed.
15
+
* Errors in module configuration will only disable the module, not stop the bot.
16
+
* 💡 Errors in the built-in-configuration will still shut down the bot
17
+
* Module-Configuration will now only be generated on startup, not if configuration gets reloaded
18
+
* Added `disableModule` to helpers.js
19
+
* Improved `embedType` function
20
+
*`asyncForEach` is now deprecated, will be removed in v3.1.0
21
+
* Performance: To reduce the number of event listeners on `command`, every event used by every module will only once register an
22
+
event listener. When an event gets invoked, the bot will run every registered module-event. To ensure fast reaction-times, this will get done synchronously.
23
+
24
+
5
25
## v2.1.0
26
+
6
27
* Added new concept of localization
7
28
* Updated modules to the newest version, including new features, localization and bug-fixes
8
29
* Introduced new helper-functions and database-schemes (including channelLock, DatabaseSchemeVerison)
Copy file name to clipboardExpand all lines: README.md
+21-44Lines changed: 21 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,12 +35,13 @@ Please read the full [license](LICENSE). This is not legal advice.
35
35
36
36
As mentioned above our business model is to host these bots for servers - it does not really make sense to publish our
37
37
product here - but we do it anyway - but we need your support! Feel free to [contribute](.github/CONTRIBUTING.md)
38
-
, [donate on Patreon](https://patreon.com/scnetwork), [subscribe to a membership](https://membership.sc-network.net),
38
+
, [donate on Patreon](https://patreon.com/scnetwork)
39
39
or on [any other platform](https://github.com/SCNetwork/CustomDCBot?sponsor=1). Thank you so much <3
40
40
41
41
## Please read this issue before continuing.
42
42
43
-
This repo does not get any new modules, but will get updates regarding core-functionality. [Learn more](https://github.com/SCNetwork/CustomDCBot/issues/13).
43
+
This repo does not get any new modules or features
@@ -60,6 +61,11 @@ This repo does not get any new modules, but will get updates regarding core-func
60
61
6. The bot is now generating a `modules.json` and a `strings.json` file inside your `config` directory. You
61
62
can [change](#configuration) them.
62
63
64
+
When reading thought the code, you may encounter code "tracking" parts of the bot.
65
+
This part is only enabled in the SCNX-Version (and users can opt-out there if the want to).
66
+
This open-source-version won't contact SCNX, SC Network and won't share any information with us, don't worry. You
67
+
can verify this by looking at the source code, [science.js](src/functions/science.js) looks like a great start-point.
68
+
63
69
### Features
64
70
65
71
* Everything is split in different [modules](#modules) - you can enable, configure and disable it how you want
@@ -108,7 +114,7 @@ Please read the license for more information.
108
114
109
115
**Before you make a module**: Please create an issue with your suggestion and claim that you are working on it so nobody
110
116
is working on the same thing (;\
111
-
Also please read the [Rules for modules](#rules-for-modules).\
117
+
Also please read the [Rues for modules](#rules-for-modules).\
112
118
**Submit a module**: Simply create a pullrequest, and we will check your module and merge it then (;
113
119
114
120
#### Rules for modules
@@ -122,34 +128,31 @@ Every module should
122
128
* create as few commands as possible (we have a limit to 100 commands in total), so please try to
123
129
use [Sub-Commands](https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups)
124
130
wherever possible (eg: instead of having /ban, /kick, /mute etc, have a /moderate command with sub-commands)
125
-
* Use the newest features of the discord api and discord.js (buttons, selects, auto-complete, etc) if possible
126
-
* process and save only needed user information and data. If sensitive data (for example message content) gets stored (should not be needed), it has to be encrypted according to [Discord'S Developers Terms of Service](https://discord.com/developers/docs/legal)
131
+
* Use the newest features of the discord api and discord.js (buttons, selects, etc) if possible
132
+
* process only needed user information and data
127
133
* follow our [terms of service](https://sc-net.work/tos), [Discord's Terms of Service](https://discord.com/tos) and
128
134
the [Discord Developer Terms of Service](https://discord.com/developers/docs/legal). A module should not allow users
129
135
to bypass or break the mentioned documents. This includes but is not limited to Nitro-Only-Features.
130
-
* should support [localization](#localization) fully, it's enough to translate to english, our volunteers are happy to translate it to german
131
136
132
137
#### module.json
133
138
134
139
Every module has to contain a `module.json` file with the following content:
135
140
136
141
*`name` of the module. Should be the same as the name of your dictionary.
137
-
*`humanReadableName`: Name shown to users (Supports [localization](#localization-in-configuration-files))
138
142
*`author`
139
143
*`name`: Name of the author
140
144
*`link`: Link to the author
141
-
*`description`: Short description of the module (Supports [localization](#localization-in-configuration-files))
145
+
*`description`: Short description of the module
142
146
*`cli` (optional): [CLI-File](#cli-files) of your module
143
147
*`commands-dir` (optional): Directory inside your module folder where all
144
148
the [interaction-command-files](#interaction-command) are in
145
-
*`message-commands-dir` (optional, not recommended if not necessary): Directory inside your module folder where all
146
-
the [message-command-files](#message-command) are in
147
149
*`on-load-event` (optional): File with exported `onLoad` function in it. Gets executed when your commands got loaded
148
150
successfully; at this point the Client is not logged in yet, so you can't communicate with Discord (yet).
149
151
*`events-dir` (optional): Directory inside your module folder where all the [event-files](#events) are in
150
152
*`models-dir` (optional): Directory inside your module folder where all the models-files are in
151
153
*`config-example-files` (optional, seriously leave this out when you don't have config files): Array
152
154
of [config-files](#example-config-file) inside your module directory.
155
+
*`tags` (optional): Array of tags.
153
156
154
157
#### Interaction-Command
155
158
@@ -186,19 +189,8 @@ An interaction-command ("slash command") file has to export the following things
186
189
187
190
#### Message-Command
188
191
189
-
A message-command file has to export the following things:
190
-
191
-
*`run`: Function that gets triggered if the command gets executed (provided arguments: `client` (discord.js Client)
192
-
, `msg` (MessageObject),
193
-
`args` (Array of arguments))
194
-
*`help`
195
-
*`name`: Name of the command (should be the same name as the file name)
196
-
*`description`: Description of the command
197
-
*`aliases`: Array of all aliases. Should contain the value of `name`.
198
-
*`config`
199
-
*`args`: How many arguments does this command *at least* need?
200
-
*`restricted`: Can this command only be run one of the bot operators (e.g. config reloading, change status or ...,
201
-
boolean)
192
+
Starting V3, message-commands are no longer supported. Please use [Interaction-Commands](#interaction-command)
193
+
instead. Read more in [CHANGELOG.md](CHANGELOG.md).
202
194
203
195
#### Events
204
196
@@ -227,26 +219,23 @@ Note: All you CLI-Commands can also get executed via the API.
227
219
228
220
An example config file should include the following things:
229
221
230
-
*`filename`: Name of the generated config file
231
-
*`humanname`: Name shown to users of the configuration file (Supports [localization](#localization-in-configuration-files))
232
-
*`description`: Description of the configuration file (Supports [localization](#localization-in-configuration-files))
222
+
*`filename`: Name of the generated config file
233
223
*`configElements` (boolean, default: false): If enabled the configuration-file will be an array of an object of the
234
224
content-fields
235
225
*`content`: Array of content fields:
236
226
*`field_name`: Name of the config field
237
-
*`humanname`: Name of the configuration field, shown to users (Supports [localization](#localization-in-configuration-files))
238
-
*`default`: Default value (Supports [localization](#localization-in-configuration-files))
227
+
*`default`: Default value
239
228
*`type`: Can be `channelID`, `select`, `roleID`, `boolean`, `integer`, `array`, `keyed` (codename for an JS-Object)
240
229
or `string`
241
-
*`description`: Short description of this field (Supports [localization](#localization-in-configuration-files))
230
+
*`description`: Short description of this field
242
231
*`allowEmbed` (if type === `array, keyed or string`): Allow the usage of an [embed](#configuration) (Note: Please
243
232
use the build-in function in `src/functions/helpers.js`)
244
233
*`content` (if type === `array`): Type (see `type` above) of every value
245
234
*`content` (if type === `select`): Array of the possible options
246
235
*`content` (if type === `keyed`):
247
236
*`key`: Type (see `type` above) of the index of every value
248
237
*`value`: Type (see `type` above) of the value of every value
249
-
*`params` (if type === `string`, array, optional, Supports [localization](#localization-in-configuration-files))
238
+
*`params` (if type === `string`, array, optional)
250
239
*`name`: Name of the parameter (e.g. `%mention%`)
251
240
*`description`: Description of the parameter (e.g. `Mention of the user`)
252
241
*`fieldValue` (only if type === `select`): If set, the parameter can only be used if the value of the field
@@ -264,21 +253,9 @@ please push the return value to `client.intervals` to get them removed on `confi
264
253
265
254
#### Helper-Functions
266
255
267
-
The bot includes a lot of functions to make your live easier™. Please open
256
+
The bot includes a lot of functions to make your live easier. Please open
268
257
the [DevDoc](https://custombot-devdocs.sc-network.net/) to see all of them.
269
258
270
-
#### Localization
271
-
272
-
We support localization for multiple languages. Developers can use `localize(moduleName, StringName, {replaceOption: replaceOptionValue}` to
273
-
use localized value, to add new strings, add it under the language key (we only publish the english translation at the moment, so `en`) and
274
-
under the module- / part-name. Please see [Localization in configuration files](#localization-in-configuration-files) to learn about localization in configuration files - I promise, it's stupidly easy.
275
-
276
-
#### Localization in configuration files
277
-
It's stupidly easy - you just put the locale string after the key, for example:
278
-
The key `description` becomes `description-en` to localize in the english language.
279
-
Fallback-Patern: `description-[userLanguage]` -> `description-en` -> `description`, which means that
"missing-moduleconf": "Missing moduleConfig-file. Automatically disabling all modules and overwriting modules.json later",
6
6
"sync-db": "Synced database",
7
-
"login-error": "Bot could not log in. Please try updating your token and restarting your bot.",
8
-
"not-invited": "Please invite the bot to your guild before continuing: %inv",
7
+
"login-error": "Bot could not log in. Error: %e",
8
+
"login-error-token": "Bot could not log in because the provided token is invalid. Please update your token.",
9
+
"login-error-intents": "Bot could not log in because the intents were not enabled correctly. Please enable \"PRESENCE INTENT\", \"SERVER MEMBERS INTENT\" and \"MESSAGE CONTENT INTENT\" in your Discord-Developer-Dashboard: %url", "not-invited": "Please invite the bot to your guild before continuing: %inv",
9
10
"logged-in": "Bot logged in as %tag and is now online.",
10
11
"logchannel-wrong-type": "There is no Log-Channel set or it has the wrong type (only text-channels are supported).",
11
12
"config-check-failed": "Configuration-Check failed. You can find more information in your log. The bot exited.",
@@ -26,22 +27,24 @@
26
27
"loaded-cli": "Loaded API-Action %c in %p",
27
28
"channel-lock": "Locked channel",
28
29
"channel-unlock": "Unlocked channel",
29
-
"channel-unlock-data-not-found": "Unlocking channel with ID %c failed because it was never locked (which is weird to beginn with)."
30
+
"channel-unlock-data-not-found": "Unlocking channel with ID %c failed because it was never locked (which is weird to beginn with).",
31
+
"module-disable": "Module %m got disabled because %r",
32
+
"migrate-success": "Migration from %o to %m finished successfully."
30
33
},
31
34
"reload": {
32
35
"reloading-config": "Reloading configuration...",
33
36
"reloading-config-with-name": "User %tag is reloading the configuration...",
"reloaded-config": "Configuration reloaded successfully.\nOut of %totalModules modules, %enabled were enabled, %configDisabled were disabled because their configuration was wrong.",
"reload-successful-syncing-commands": "Configuration reloaded successfully, syncing commands, to make sure permissions are up-to-date...",
37
40
"reload-failed-message": "**FAILED**\n```%r```\n**Please read your log to find more information**\nThe bot will kill itself now, bye :wave:",
38
41
"command-description": "Reloads the configuration"
39
42
},
40
43
"config": {
41
44
"checking-config": "Checking configurations...",
42
-
"done-with-checking": "Done with checking.",
45
+
"done-with-checking": "Done with checking. Out of %totalModules modules, %enabled were enabled, %configDisabled were disabled because their configuration was wrong.",
43
46
"creating-file": "Config %m/%f does not exist - I'm going to create it, please stand by...",
44
-
"checking-of-field-failed": "An error occurred while checking the content of field %fieldName in %m/$f",
47
+
"checking-of-field-failed": "An error occurred while checking the content of field \"%fieldName\" in %m/%f",
45
48
"saved-file": "Configuration-File %f in %m was saved successfully.",
46
49
"moduleconf-regeneration": "Regenerating module configuration, no settings will be overwritten, don't worry.",
0 commit comments