Update config schema and example

This commit is contained in:
Noi 2022-12-04 17:09:41 -08:00
parent 681e702406
commit 6323134285
4 changed files with 101 additions and 66 deletions

44
ConfigurationSchema.json Normal file
View file

@ -0,0 +1,44 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"BotToken": {
"type": "string",
"description": "The token used by the bot to connect to Discord."
},
"Assemblies": {
"type": "array",
"description": "A list of additional files to be loaded to extend the bot's functionality.",
"default": [ "RegexBot.dll" ]
},
"DatabaseOptions": {
"type": "object",
"description": "A set of options for the SQL database connection.",
"properties": {
"Host": {
"type": "string",
"description": "The SQL host, whether a hostname, IP address, or path to a socket."
},
"Database": {
"type": "string",
"description": "The target SQL database name to connect to, if different from the default."
},
"Username": {
"type": "string",
"description": "The username used for SQL server authentication."
},
"Password": {
"type": "string",
"description": "The password used for SQL server authentication."
}
},
"required": [ "Username", "Password" ]
},
"Servers": {
"type": "object",
"description": "A collection of server configurations with keys representing server IDs and values containing the respective server's configuration."
/* TODO unfinished */
}
},
"required": [ "BotToken", "DatabaseOptions", "Servers" ]
}

View file

@ -1,45 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/NoiTheCat/RegexBot/main/ServerConfigSchema.json",
"Name": "SERVER NAME", // Server name is optional, but useful as a reference
"Moderators": [
// Users and roles are accepted here.
"MODERATOR"
],
/*
The following configuration is provided as a sample for commonly-used features.
For a detailed reference which includes all possible configuration settings, see:
(TODO put documentation link here)
*/
"RegexModerator": [
{
"Label": "No cheese",
"Regex": "cheese",
"Response": [
"say #_ You can't say that, that's illegal",
"delete"
]
},
{
"Label": "Secret club initiation",
"Regex": "my name is .* and I dislike cheese",
"Response": [
"say @_ We welcome you.",
"addrole &00000::Secret Club member"
]
}
],
"AutoResponder": [
{
"Label": "Infinite no u",
"Regex": "no u",
"Reply": "no u"
},
{
"Label": "Acknowledge praise",
"Regex": "yes u",
"Reply": ":blush:"
}
]
}

57
SampleConfiguration.json Normal file
View file

@ -0,0 +1,57 @@
{
"$schema": "https://raw.githubusercontent.com/NoiTheCat/RegexBot/main/ConfigurationSchema.json",
"BotToken": "12345678901234567890qwertyuiop.1234567890",
//"Assemblies": [ "RegexBot.dll" ],
"DatabaseOptions": {
"Username": "regexbot",
"Password": "regexbot"
},
"Servers": {
"00000000": { // Place server ID here
"Name": "SERVER NAME", // Server name is unused by the bot, but is useful as a reference.
"Moderators": [
// Users and roles are accepted here.
"MODERATOR"
],
/*
The following configuration is provided as a sample for commonly-used features.
For a detailed reference which includes all possible configuration settings, see
this project's documentation.
*/
"RegexModerator": [
{
"Label": "No cheese",
"Regex": "cheese",
"Response": [
"say #_ You can't say that, that's illegal",
"delete"
]
},
{
"Label": "Secret club initiation",
"Regex": "my name is .* and I (hate|dislike) cheese",
"Response": [
"say @_ We welcome you.",
"addrole &00000::Secret Club member"
]
}
],
"AutoResponder": [
{
"Label": "Infinite no u",
"Regex": "no u",
"Reply": "no u"
},
{
"Label": "Acknowledge praise",
"Regex": "yes u",
"Reply": ":blush:"
}
]
}
}
}

View file

@ -1,21 +0,0 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"Name": {
"type": "string",
"description": "The server's name. The value is unused by the application and is only for user reference."
},
"Moderators": {
"type": "array",
"description": "A list of entities which the bot should recognize as moderators.",
"items": {
"type": "string"
}
}
/* schema still a work in progress */
},
"required": [
"Moderators"
]
}