Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

## v3.7.0
* Rework of configuration localization and loading. All files got migrated.
* Synced open source-version with close-source-SCNX-version. Please read the detailed changelog on our Discord to learn about new module functionality.
* feat(economy-system): Added ability to make command-replies public ([#79](https://github.com/SCNetwork/CustomDCBot/pull/79))
* feat(Twitch-Notifications): Added live-Roles ([#81](https://github.com/SCNetwork/CustomDCBot/pull/81))

## v3.6.0
* Support for configuration-example-file `content.elementToggle` toggle to improve UX in the SCNX Dashboard ([#76](https://github.com/SCNetwork/CustomDCBot/pull/76))
* Support for configuration-example-file `content.dependsOn` toggle to improve UX in the SCNX Dashboard ([#76](https://github.com/SCNetwork/CustomDCBot/pull/76))
Expand Down
30 changes: 10 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,14 @@ translationable systems in your module.
works)
* `string`: Name of the string
* `replace` (optional, object): Will replace `%<key>` in the source string by `<value>`
* Localizations of configuration-files and user-editable strings: You can specify field-fields like `description`
, `default` and more in multiple languages. The bot / dashboard will choose the correct one automatically.
* 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.

#### module.json

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

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

* `filename`: Name of the generated config file
* `humanname-<lang>`: Name of the file, shown to users (fallback order: `humanname-<lang>`, `humanname-en`, `filename`)
* `description-<lang>`: Description of the file, shown to users (fallback order: `humanname-<lang>`, `humanname-en`
, `No description, but you can configure <name> here`)
* `humanname`: [Localized](#localization) name of the file, shown to users
* `description`: [Localized](#localization) description of the file, shown to users
* `configElements` (boolean, default: false): If enabled the configuration-file will be an array of an object of the
content-fields
* `commandsWarnings`: This field is used to indicate, that users need to manually set up the permissions for commands in
Expand All @@ -276,15 +272,12 @@ An example config file should include the following things:
* `info`: Key by language; Information about the command; used to explain users what exactly they should do
* `content`: Array of content fields:
* `field_name`: Name of the config field
* `default-<lang>`: Default value of this field (replace `<lang>` with a supported language code),
Fallback-Order: `default-<lang>`, `default-en`, `default`
* `default`: [Localized](#localization) default value of this field
* `type`: Can be `channelID`, `userID`, `imgURL`, `select`, `timezone` (treated as string, please check validity before using), `roleID`
, `boolean`, `integer`, `array`, `keyed` (codename for an JS-Object)
or `string`
* `description-<lang>`: Description of this field (replace `<lang>` with a supported language code),
Fallback-Order: `description-<lang>`, `description-en`, `description`
* `humanname-<lang>`: Name of this field show to users (replace `<lang>` with a supported language code),
Fallback-Order: `humanname-<lang>`, `humanname-en`, `humanname`, `field_name`
* `description`: [Localized](#localization) description of this field
* `humanname`: [Localized](#localization) name of this field show to users
* `allowEmbed` (if type === `array, keyed or string`): Allow the usage of an [embed](#configuration) (Note: Please
use the build-in function in `src/functions/helpers.js`)
* `content` (if type === `array`): Type (see `type` above) of every value
Expand All @@ -297,12 +290,9 @@ An example config file should include the following things:
* `content` (if type === `keyed`):
* `key`: Type (see `type` above) of the index of every value
* `value`: Type (see `type` above) of the value of every value
* `params-<lang>` (if type === `string`, array, optional, replace `<lang>` with supported language code,
Fallback-Order: `params-<lang>`, `params-en`, `params`)
* `params`: (if type === `string`, array, optional) Possible parameters
* `name`: Name of the parameter (e.g. `%mention%`)
* `description`: Description of the parameter (e.g. `Mention of the user`)
* `fieldValue` (only if type === `select`): If set, the parameter can only be used if the value of the field
is `fieldValue`.
* `description`: [Localized](#localization) Description of the parameter (e.g. `Mention of the user`)
* `isImage`: If true, users will be able to set this parameter as Image, Author-Icon, Footer-Icon or Thumbnail
of an embed (only if `allowEmbed` is enabled)
* `allowNull` (default: `false`, optional): If the value of this field can be empty
Expand Down
218 changes: 140 additions & 78 deletions config-generator/config.json
Original file line number Diff line number Diff line change
@@ -1,72 +1,109 @@
{
"description-en": "Configure the basic features of the bot here",
"description-de": "Generelle Konfiguration deines Bots",
"humanname-de": "Konfiguration",
"humanname-en": "Configuration",
"description": {
"en": "Configure the basic features of the bot here",
"de": "Generelle Konfiguration deines Bots"
},
"humanName": {
"en": "Configuration",
"de": "Konfiguration"
},
"filename": "config.json",
"content": [
{
"field_name": "token",
"default": "yourtokengoeshere",
"type": "string",
"description": "Replace this with your token",
"hidden": true
},
{
"field_name": "scnxToken",
"default": "yourtokengoeshere",
"type": "string",
"description": "Replace this with your token",
"hidden": true
"name": "token",
"humanName": {},
"default": {
"en": "yourtokengoeshere"
},
"description": {
"en": "Replace this with your token"
},
"hidden": true,
"type": "string"
},
{
"field_name": "prefix",
"humanname-de": "Prefix deines Botes",
"humanname-en": "Prefix of your bot",
"default": "!",
"type": "string",
"description-en": "Set the prefix of your bot here",
"description-de": "Dein eigener Prefix - Wir empfehlen ihn einfach bei ! zu belassen."
"name": "prefix",
"humanName": {
"en": "Prefix of your bot",
"de": "Prefix deines Botes"
},
"default": {
"en": "!"
},
"description": {
"en": "Set the prefix of your bot here",
"de": "Dein eigener Prefix - Wir empfehlen ihn einfach bei ! zu belassen."
},
"type": "string"
},
{
"field_name": "botOperators",
"default": [],
"type": "array",
"content": "string",
"name": "botOperators",
"humanName": {},
"default": {
"en": []
},
"description": {
"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)"
},
"hidden": true,
"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)"
"type": "array",
"content": "string"
},
{
"field_name": "guildID",
"default": "489786377261678592",
"type": "guildID",
"name": "guildID",
"humanName": {},
"default": {
"en": "489786377261678592"
},
"description": {
"en": "Replace this the id of the guild the bot should work in."
},
"hidden": true,
"description": "Replace this the id of the guild the bot should work in."
"type": "guildID"
},
{
"field_name": "disableStatus",
"humanname-en": "Disable Bot-Status",
"humanname-de": "Bot-Status deaktivieren",
"default": false,
"type": "boolean",
"description-en": "If enabled, the bot won't have a status in discord",
"description-de": "Wenn aktiviert wird der Bot keinen Status in Discord haben"
"name": "disableStatus",
"humanName": {
"en": "Disable Bot-Status",
"de": "Bot-Status deaktivieren"
},
"default": {
"en": false
},
"description": {
"en": "If enabled, the bot won't have a status in discord",
"de": "Wenn aktiviert wird der Bot keinen Status in Discord haben"
},
"type": "boolean"
},
{
"field_name": "user_presence",
"humanname-en": "Bot-Status",
"default": "You can change this in your config.json btw",
"type": "string",
"description-en": "This will show up in Discord as \"Playing <YourValue>\"",
"description-de": "Das wird in Discord als \"Spielt <Hier der Wert>\" angezeigt"
"name": "user_presence",
"humanName": {
"en": "Bot-Status"
},
"default": {
"en": "Change this in your Bot-Configuration on scnx.app",
"de": "Ändere das in deiner Bot-Konfiguration auf scnx.app"
},
"description": {
"en": "This will show up in Discord as \"Playing <YourValue>\"",
"de": "Das wird in Discord als \"Spielt <Hier der Wert>\" angezeigt"
},
"type": "string"
},
{
"field_name": "logLevel",
"humanname-en": "Logging-Level",
"default": "debug",
"name": "logLevel",
"humanName": {
"en": "Logging-Level"
},
"default": {
"en": "debug"
},
"description": {
"en": "Log-Level of the bot. Leave it as it is, if you don't know what this means",
"de": "Log-Level des Bots. Belasse es wie es ist, wenn du nicht weißt, was das bedeutet."
},
"type": "select",
"description-en": "Log-Level of the bot. Leave it as it is, if you don't know what this means",
"description-de": "Log-Level des Bots. Belasse es wie es ist, wenn du nicht weißt, was das bedeutet.",
"content": [
"debug",
"info",
Expand All @@ -77,41 +114,66 @@
]
},
{
"field_name": "timezone",
"humanname-en": "Timezone",
"humanname-de": "Zeitzone",
"default": "Europe/Berlin",
"type": "timezone",
"description-en": "Timezone the bot runs in",
"description-de": "Zeitzone in der der Bot laufen soll"
"name": "logChannelID",
"humanName": {
"en": "Log-Channel",
"de": "Log-Kanal"
},
"default": {
"en": ""
},
"description": {
"en": "Default log-channel for most modules and used to log relevant information",
"de": "Standard Log-Kanal für viele Module. Wird außerdem genutzt, um wesentliche Bot-Informationen zu senden"
},
"type": "channelID",
"allowNull": true
},
{
"field_name": "logChannelID",
"allowNull": true,
"humanname-en": "Log-Channel",
"humanname-de": "Log-Kanal",
"default": "",
"type": "channelID",
"description-en": "Default log-channel for most modules and used to log relevant information",
"description-de": "Standard Log-Kanal für viele Module. Wird außerdem genutzt, um wesentliche Bot-Informationen zu senden"
"name": "timezone",
"humanName": {
"en": "Timezone",
"de": "Zeitzone"
},
"default": {
"en": "Europe/Berlin"
},
"description": {
"en": "Timezone the bot runs in",
"de": "Zeitzone in der der Bot laufen soll"
},
"type": "timezone"
},
{
"field_name": "disableEveryoneProtection",
"humanname-en": "Allow @everyone / @here pings",
"humanname-de": "@everyone und @here Pings erlauben",
"default": false,
"name": "disableEveryoneProtection",
"humanName": {
"en": "Allow @everyone / @here pings",
"de": "@everyone und @here Pings erlauben"
},
"default": {
"en": false
},
"description": {
"en": "Allows @everyone and @here pings for messages configurable in the dashboard",
"de": "Erlaubt @everyone und @here pings in im Dashboard anpassbaren Nachrichten"
},
"type": "boolean",
"description-de": "Erlaubt @everyone und @here pings in im Dashboard anpassbaren Nachrichten",
"description-en": "Allows @everyone and @here pings for messages configurable in the dashboard"
"pro": true
},
{
"field_name": "syncCommandGlobally",
"default": false,
"type": "boolean",
"humanname-en": "Sync module commands as global commands",
"humanname-de": "Speichere Modul-Befehle als Globale-Befehle",
"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.",
"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."
"name": "syncCommandGlobally",
"humanName": {
"en": "Sync module commands as global commands",
"de": "Speichere Modul-Befehle als Globale-Befehle"
},
"default": {
"en": false
},
"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.",
"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."
},
"type": "boolean"
}
]
}
Loading