Skip to content

Commit 26ab149

Browse files
authored
feat: v3.7.0 (#85)
1 parent 68918f8 commit 26ab149

File tree

118 files changed

+8226
-5562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+8226
-5562
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
This changelog contains mostly API-Changes and changes for developers.
44

5+
## v3.7.0
6+
* Rework of configuration localization and loading. All files got migrated.
7+
* Synced open source-version with close-source-SCNX-version. Please read the detailed changelog on our Discord to learn about new module functionality.
8+
* feat(economy-system): Added ability to make command-replies public ([#79](https://github.com/SCNetwork/CustomDCBot/pull/79))
9+
* feat(Twitch-Notifications): Added live-Roles ([#81](https://github.com/SCNetwork/CustomDCBot/pull/81))
10+
511
## v3.6.0
612
* Support for configuration-example-file `content.elementToggle` toggle to improve UX in the SCNX Dashboard ([#76](https://github.com/SCNetwork/CustomDCBot/pull/76))
713
* Support for configuration-example-file `content.dependsOn` toggle to improve UX in the SCNX Dashboard ([#76](https://github.com/SCNetwork/CustomDCBot/pull/76))

README.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,14 @@ translationable systems in your module.
161161
works)
162162
* `string`: Name of the string
163163
* `replace` (optional, object): Will replace `%<key>` in the source string by `<value>`
164-
* Localizations of configuration-files and user-editable strings: You can specify field-fields like `description`
165-
, `default` and more in multiple languages. The bot / dashboard will choose the correct one automatically.
164+
* Localizations of configuration-files and user-editable strings: All localizable configuration fields are an object with values keyed based on language codes. Example: `{"description": {"de": "Beschreibung des Feldes", "en": "Description of the field"}`. Each field needs to have at least an English value, as every other language will default back to English.
166165

167166
#### module.json
168167

169168
Every module has to contain a `module.json` file with the following content:
170169

171170
* `name` of the module. Should be the same as the name of your dictionary.
172-
* `humanReadableName`: English name of the module, shown to users
173-
* `humanReadableName-<lang>`: Replace `<lang>` with any supported language-code (currently: `de`, `en`); Name of the
174-
module show to users (fallback order: `humanReadableName-<lang>`, `humanReadableName-en`, `humanReadableName`)
171+
* `humanReadableName`: [Localized](#localization) name of the module, shown to users
175172
* `author`
176173
* `name`: Name of the author
177174
* `link`: Link to the author
@@ -180,7 +177,7 @@ Every module has to contain a `module.json` file with the following content:
180177
* `openSourceURL`: URL to the Source-Code of the module licensed under an Open-Source-License (will show
181178
donation-banners in the SCNX Dashboard (if orgID is set) and qualifies (qualified) developers for financial support
182179
from the Open-Source-Pool of SCNX)
183-
* `description`: Short description of the module
180+
* `description`: [Localized](#localization) short description of the module
184181
* `cli` (optional): [CLI-File](#cli-files) of your module
185182
* `commands-dir` (optional): Directory inside your module folder where all
186183
the [interaction-command-files](#interaction-command) are in
@@ -262,9 +259,8 @@ use `node add-config-element-object.js <Path to example config file> <Path to yo
262259
An example config file should include the following things:
263260

264261
* `filename`: Name of the generated config file
265-
* `humanname-<lang>`: Name of the file, shown to users (fallback order: `humanname-<lang>`, `humanname-en`, `filename`)
266-
* `description-<lang>`: Description of the file, shown to users (fallback order: `humanname-<lang>`, `humanname-en`
267-
, `No description, but you can configure <name> here`)
262+
* `humanname`: [Localized](#localization) name of the file, shown to users
263+
* `description`: [Localized](#localization) description of the file, shown to users
268264
* `configElements` (boolean, default: false): If enabled the configuration-file will be an array of an object of the
269265
content-fields
270266
* `commandsWarnings`: This field is used to indicate, that users need to manually set up the permissions for commands in
@@ -276,15 +272,12 @@ An example config file should include the following things:
276272
* `info`: Key by language; Information about the command; used to explain users what exactly they should do
277273
* `content`: Array of content fields:
278274
* `field_name`: Name of the config field
279-
* `default-<lang>`: Default value of this field (replace `<lang>` with a supported language code),
280-
Fallback-Order: `default-<lang>`, `default-en`, `default`
275+
* `default`: [Localized](#localization) default value of this field
281276
* `type`: Can be `channelID`, `userID`, `imgURL`, `select`, `timezone` (treated as string, please check validity before using), `roleID`
282277
, `boolean`, `integer`, `array`, `keyed` (codename for an JS-Object)
283278
or `string`
284-
* `description-<lang>`: Description of this field (replace `<lang>` with a supported language code),
285-
Fallback-Order: `description-<lang>`, `description-en`, `description`
286-
* `humanname-<lang>`: Name of this field show to users (replace `<lang>` with a supported language code),
287-
Fallback-Order: `humanname-<lang>`, `humanname-en`, `humanname`, `field_name`
279+
* `description`: [Localized](#localization) description of this field
280+
* `humanname`: [Localized](#localization) name of this field show to users
288281
* `allowEmbed` (if type === `array, keyed or string`): Allow the usage of an [embed](#configuration) (Note: Please
289282
use the build-in function in `src/functions/helpers.js`)
290283
* `content` (if type === `array`): Type (see `type` above) of every value
@@ -297,12 +290,9 @@ An example config file should include the following things:
297290
* `content` (if type === `keyed`):
298291
* `key`: Type (see `type` above) of the index of every value
299292
* `value`: Type (see `type` above) of the value of every value
300-
* `params-<lang>` (if type === `string`, array, optional, replace `<lang>` with supported language code,
301-
Fallback-Order: `params-<lang>`, `params-en`, `params`)
293+
* `params`: (if type === `string`, array, optional) Possible parameters
302294
* `name`: Name of the parameter (e.g. `%mention%`)
303-
* `description`: Description of the parameter (e.g. `Mention of the user`)
304-
* `fieldValue` (only if type === `select`): If set, the parameter can only be used if the value of the field
305-
is `fieldValue`.
295+
* `description`: [Localized](#localization) Description of the parameter (e.g. `Mention of the user`)
306296
* `isImage`: If true, users will be able to set this parameter as Image, Author-Icon, Footer-Icon or Thumbnail
307297
of an embed (only if `allowEmbed` is enabled)
308298
* `allowNull` (default: `false`, optional): If the value of this field can be empty

config-generator/config.json

Lines changed: 140 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,109 @@
11
{
2-
"description-en": "Configure the basic features of the bot here",
3-
"description-de": "Generelle Konfiguration deines Bots",
4-
"humanname-de": "Konfiguration",
5-
"humanname-en": "Configuration",
2+
"description": {
3+
"en": "Configure the basic features of the bot here",
4+
"de": "Generelle Konfiguration deines Bots"
5+
},
6+
"humanName": {
7+
"en": "Configuration",
8+
"de": "Konfiguration"
9+
},
610
"filename": "config.json",
711
"content": [
812
{
9-
"field_name": "token",
10-
"default": "yourtokengoeshere",
11-
"type": "string",
12-
"description": "Replace this with your token",
13-
"hidden": true
14-
},
15-
{
16-
"field_name": "scnxToken",
17-
"default": "yourtokengoeshere",
18-
"type": "string",
19-
"description": "Replace this with your token",
20-
"hidden": true
13+
"name": "token",
14+
"humanName": {},
15+
"default": {
16+
"en": "yourtokengoeshere"
17+
},
18+
"description": {
19+
"en": "Replace this with your token"
20+
},
21+
"hidden": true,
22+
"type": "string"
2123
},
2224
{
23-
"field_name": "prefix",
24-
"humanname-de": "Prefix deines Botes",
25-
"humanname-en": "Prefix of your bot",
26-
"default": "!",
27-
"type": "string",
28-
"description-en": "Set the prefix of your bot here",
29-
"description-de": "Dein eigener Prefix - Wir empfehlen ihn einfach bei ! zu belassen."
25+
"name": "prefix",
26+
"humanName": {
27+
"en": "Prefix of your bot",
28+
"de": "Prefix deines Botes"
29+
},
30+
"default": {
31+
"en": "!"
32+
},
33+
"description": {
34+
"en": "Set the prefix of your bot here",
35+
"de": "Dein eigener Prefix - Wir empfehlen ihn einfach bei ! zu belassen."
36+
},
37+
"type": "string"
3038
},
3139
{
32-
"field_name": "botOperators",
33-
"default": [],
34-
"type": "array",
35-
"content": "string",
40+
"name": "botOperators",
41+
"humanName": {},
42+
"default": {
43+
"en": []
44+
},
45+
"description": {
46+
"en": "Bot operators can reload the configuration and perform system relevant actions with this bot. Please only add users you really trust (and yourself of course)"
47+
},
3648
"hidden": true,
37-
"description": "Bot operators can reload the configuration and perform system relevant actions with this bot. Please only add users you really trust (and yourself of course)"
49+
"type": "array",
50+
"content": "string"
3851
},
3952
{
40-
"field_name": "guildID",
41-
"default": "489786377261678592",
42-
"type": "guildID",
53+
"name": "guildID",
54+
"humanName": {},
55+
"default": {
56+
"en": "489786377261678592"
57+
},
58+
"description": {
59+
"en": "Replace this the id of the guild the bot should work in."
60+
},
4361
"hidden": true,
44-
"description": "Replace this the id of the guild the bot should work in."
62+
"type": "guildID"
4563
},
4664
{
47-
"field_name": "disableStatus",
48-
"humanname-en": "Disable Bot-Status",
49-
"humanname-de": "Bot-Status deaktivieren",
50-
"default": false,
51-
"type": "boolean",
52-
"description-en": "If enabled, the bot won't have a status in discord",
53-
"description-de": "Wenn aktiviert wird der Bot keinen Status in Discord haben"
65+
"name": "disableStatus",
66+
"humanName": {
67+
"en": "Disable Bot-Status",
68+
"de": "Bot-Status deaktivieren"
69+
},
70+
"default": {
71+
"en": false
72+
},
73+
"description": {
74+
"en": "If enabled, the bot won't have a status in discord",
75+
"de": "Wenn aktiviert wird der Bot keinen Status in Discord haben"
76+
},
77+
"type": "boolean"
5478
},
5579
{
56-
"field_name": "user_presence",
57-
"humanname-en": "Bot-Status",
58-
"default": "You can change this in your config.json btw",
59-
"type": "string",
60-
"description-en": "This will show up in Discord as \"Playing <YourValue>\"",
61-
"description-de": "Das wird in Discord als \"Spielt <Hier der Wert>\" angezeigt"
80+
"name": "user_presence",
81+
"humanName": {
82+
"en": "Bot-Status"
83+
},
84+
"default": {
85+
"en": "Change this in your Bot-Configuration on scnx.app",
86+
"de": "Ändere das in deiner Bot-Konfiguration auf scnx.app"
87+
},
88+
"description": {
89+
"en": "This will show up in Discord as \"Playing <YourValue>\"",
90+
"de": "Das wird in Discord als \"Spielt <Hier der Wert>\" angezeigt"
91+
},
92+
"type": "string"
6293
},
6394
{
64-
"field_name": "logLevel",
65-
"humanname-en": "Logging-Level",
66-
"default": "debug",
95+
"name": "logLevel",
96+
"humanName": {
97+
"en": "Logging-Level"
98+
},
99+
"default": {
100+
"en": "debug"
101+
},
102+
"description": {
103+
"en": "Log-Level of the bot. Leave it as it is, if you don't know what this means",
104+
"de": "Log-Level des Bots. Belasse es wie es ist, wenn du nicht weißt, was das bedeutet."
105+
},
67106
"type": "select",
68-
"description-en": "Log-Level of the bot. Leave it as it is, if you don't know what this means",
69-
"description-de": "Log-Level des Bots. Belasse es wie es ist, wenn du nicht weißt, was das bedeutet.",
70107
"content": [
71108
"debug",
72109
"info",
@@ -77,41 +114,66 @@
77114
]
78115
},
79116
{
80-
"field_name": "timezone",
81-
"humanname-en": "Timezone",
82-
"humanname-de": "Zeitzone",
83-
"default": "Europe/Berlin",
84-
"type": "timezone",
85-
"description-en": "Timezone the bot runs in",
86-
"description-de": "Zeitzone in der der Bot laufen soll"
117+
"name": "logChannelID",
118+
"humanName": {
119+
"en": "Log-Channel",
120+
"de": "Log-Kanal"
121+
},
122+
"default": {
123+
"en": ""
124+
},
125+
"description": {
126+
"en": "Default log-channel for most modules and used to log relevant information",
127+
"de": "Standard Log-Kanal für viele Module. Wird außerdem genutzt, um wesentliche Bot-Informationen zu senden"
128+
},
129+
"type": "channelID",
130+
"allowNull": true
87131
},
88132
{
89-
"field_name": "logChannelID",
90-
"allowNull": true,
91-
"humanname-en": "Log-Channel",
92-
"humanname-de": "Log-Kanal",
93-
"default": "",
94-
"type": "channelID",
95-
"description-en": "Default log-channel for most modules and used to log relevant information",
96-
"description-de": "Standard Log-Kanal für viele Module. Wird außerdem genutzt, um wesentliche Bot-Informationen zu senden"
133+
"name": "timezone",
134+
"humanName": {
135+
"en": "Timezone",
136+
"de": "Zeitzone"
137+
},
138+
"default": {
139+
"en": "Europe/Berlin"
140+
},
141+
"description": {
142+
"en": "Timezone the bot runs in",
143+
"de": "Zeitzone in der der Bot laufen soll"
144+
},
145+
"type": "timezone"
97146
},
98147
{
99-
"field_name": "disableEveryoneProtection",
100-
"humanname-en": "Allow @everyone / @here pings",
101-
"humanname-de": "@everyone und @here Pings erlauben",
102-
"default": false,
148+
"name": "disableEveryoneProtection",
149+
"humanName": {
150+
"en": "Allow @everyone / @here pings",
151+
"de": "@everyone und @here Pings erlauben"
152+
},
153+
"default": {
154+
"en": false
155+
},
156+
"description": {
157+
"en": "Allows @everyone and @here pings for messages configurable in the dashboard",
158+
"de": "Erlaubt @everyone und @here pings in im Dashboard anpassbaren Nachrichten"
159+
},
103160
"type": "boolean",
104-
"description-de": "Erlaubt @everyone und @here pings in im Dashboard anpassbaren Nachrichten",
105-
"description-en": "Allows @everyone and @here pings for messages configurable in the dashboard"
161+
"pro": true
106162
},
107163
{
108-
"field_name": "syncCommandGlobally",
109-
"default": false,
110-
"type": "boolean",
111-
"humanname-en": "Sync module commands as global commands",
112-
"humanname-de": "Speichere Modul-Befehle als Globale-Befehle",
113-
"description-en": "If enabled, module-commands will be synced to discord as global commands. They will show up on other servers, but won't work. Syncing can take up to 2 hours, so changes may not be reflected immediately.",
114-
"description-de": "Wenn aktiviert, werden Befehle von Modulen als Globale-Befehle zu Discord gesendet. Sie werden auf anderen Servern angezeigt, werden aber nicht funktionieren. Synchronisierung kann bis zu 2 Stunden dauern."
164+
"name": "syncCommandGlobally",
165+
"humanName": {
166+
"en": "Sync module commands as global commands",
167+
"de": "Speichere Modul-Befehle als Globale-Befehle"
168+
},
169+
"default": {
170+
"en": false
171+
},
172+
"description": {
173+
"en": "If enabled, module-commands will be synced to discord as global commands. They will show up on other servers, but won't work. Syncing can take up to 2 hours, so changes may not be reflected immediately.",
174+
"de": "Wenn aktiviert, werden Befehle von Modulen als Globale-Befehle zu Discord gesendet. Sie werden auf anderen Servern angezeigt, werden aber nicht funktionieren. Synchronisierung kann bis zu 2 Stunden dauern."
175+
},
176+
"type": "boolean"
115177
}
116178
]
117179
}

0 commit comments

Comments
 (0)