commit, am too tired to add docs here
This commit is contained in:
224
config/schemas/guild-schema.yml
Normal file
224
config/schemas/guild-schema.yml
Normal file
@@ -0,0 +1,224 @@
|
||||
# Guild Configuration Schema
|
||||
# This defines the structure and validation rules for guild configurations
|
||||
|
||||
type: object
|
||||
required:
|
||||
- guild_id
|
||||
- name
|
||||
- settings
|
||||
|
||||
properties:
|
||||
guild_id:
|
||||
type: integer
|
||||
description: "Discord guild (server) ID"
|
||||
minimum: 1
|
||||
|
||||
name:
|
||||
type: string
|
||||
description: "Human-readable guild name"
|
||||
maxLength: 100
|
||||
|
||||
owner_id:
|
||||
type: integer
|
||||
description: "Guild owner's Discord user ID"
|
||||
minimum: 1
|
||||
|
||||
premium:
|
||||
type: boolean
|
||||
description: "Whether this guild has premium features"
|
||||
default: false
|
||||
|
||||
settings:
|
||||
type: object
|
||||
required:
|
||||
- general
|
||||
- channels
|
||||
- roles
|
||||
- moderation
|
||||
- automod
|
||||
- ai_moderation
|
||||
- verification
|
||||
|
||||
properties:
|
||||
general:
|
||||
type: object
|
||||
properties:
|
||||
prefix:
|
||||
type: string
|
||||
description: "Command prefix"
|
||||
minLength: 1
|
||||
maxLength: 10
|
||||
default: "!"
|
||||
locale:
|
||||
type: string
|
||||
description: "Language locale"
|
||||
pattern: "^[a-z]{2}$"
|
||||
default: "en"
|
||||
|
||||
channels:
|
||||
type: object
|
||||
description: "Channel configuration (Discord channel IDs)"
|
||||
properties:
|
||||
log_channel_id:
|
||||
type: [integer, "null"]
|
||||
description: "General event log channel"
|
||||
minimum: 1
|
||||
mod_log_channel_id:
|
||||
type: [integer, "null"]
|
||||
description: "Moderation action log channel"
|
||||
minimum: 1
|
||||
welcome_channel_id:
|
||||
type: [integer, "null"]
|
||||
description: "Welcome message channel"
|
||||
minimum: 1
|
||||
|
||||
roles:
|
||||
type: object
|
||||
description: "Role configuration (Discord role IDs)"
|
||||
properties:
|
||||
mute_role_id:
|
||||
type: [integer, "null"]
|
||||
description: "Role for timed-out members"
|
||||
minimum: 1
|
||||
verified_role_id:
|
||||
type: [integer, "null"]
|
||||
description: "Role given after verification"
|
||||
minimum: 1
|
||||
mod_role_ids:
|
||||
type: array
|
||||
description: "Moderator roles"
|
||||
items:
|
||||
type: integer
|
||||
minimum: 1
|
||||
default: []
|
||||
|
||||
moderation:
|
||||
type: object
|
||||
properties:
|
||||
automod_enabled:
|
||||
type: boolean
|
||||
description: "Enable automatic moderation"
|
||||
default: true
|
||||
anti_spam_enabled:
|
||||
type: boolean
|
||||
description: "Enable anti-spam protection"
|
||||
default: true
|
||||
link_filter_enabled:
|
||||
type: boolean
|
||||
description: "Enable link filtering"
|
||||
default: false
|
||||
strike_actions:
|
||||
type: object
|
||||
description: "Actions to take at strike thresholds"
|
||||
patternProperties:
|
||||
"^[0-9]+$":
|
||||
type: object
|
||||
required: [action]
|
||||
properties:
|
||||
action:
|
||||
type: string
|
||||
enum: [warn, timeout, kick, ban]
|
||||
duration:
|
||||
type: integer
|
||||
minimum: 1
|
||||
description: "Duration in seconds (for timeout/ban)"
|
||||
default:
|
||||
"1": {action: warn}
|
||||
"3": {action: timeout, duration: 3600}
|
||||
"5": {action: kick}
|
||||
"7": {action: ban}
|
||||
|
||||
automod:
|
||||
type: object
|
||||
description: "Automatic moderation settings"
|
||||
properties:
|
||||
message_rate_limit:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 50
|
||||
description: "Messages per time window"
|
||||
default: 5
|
||||
message_rate_window:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 300
|
||||
description: "Time window in seconds"
|
||||
default: 5
|
||||
duplicate_threshold:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 20
|
||||
description: "Duplicate messages to trigger action"
|
||||
default: 3
|
||||
mention_limit:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 50
|
||||
description: "Maximum mentions per message"
|
||||
default: 5
|
||||
mention_rate_limit:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
description: "Mentions per time window"
|
||||
default: 10
|
||||
mention_rate_window:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 3600
|
||||
description: "Mention time window in seconds"
|
||||
default: 60
|
||||
scam_allowlist:
|
||||
type: array
|
||||
description: "Domains allowed to bypass scam detection"
|
||||
items:
|
||||
type: string
|
||||
pattern: "^[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
|
||||
default: []
|
||||
|
||||
ai_moderation:
|
||||
type: object
|
||||
description: "AI-powered moderation settings"
|
||||
properties:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: "Enable AI moderation"
|
||||
default: true
|
||||
sensitivity:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
description: "AI sensitivity level (higher = stricter)"
|
||||
default: 80
|
||||
confidence_threshold:
|
||||
type: number
|
||||
minimum: 0.0
|
||||
maximum: 1.0
|
||||
description: "Minimum confidence to take action"
|
||||
default: 0.7
|
||||
log_only:
|
||||
type: boolean
|
||||
description: "Only log violations, don't take action"
|
||||
default: false
|
||||
nsfw_detection_enabled:
|
||||
type: boolean
|
||||
description: "Enable NSFW image detection"
|
||||
default: true
|
||||
nsfw_only_filtering:
|
||||
type: boolean
|
||||
description: "Only filter sexual content, allow violence/harassment"
|
||||
default: false
|
||||
|
||||
verification:
|
||||
type: object
|
||||
description: "Member verification settings"
|
||||
properties:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: "Enable verification for new members"
|
||||
default: false
|
||||
type:
|
||||
type: string
|
||||
enum: [button, captcha, math, emoji]
|
||||
description: "Verification challenge type"
|
||||
default: button
|
||||
175
config/schemas/wordlists-schema.yml
Normal file
175
config/schemas/wordlists-schema.yml
Normal file
@@ -0,0 +1,175 @@
|
||||
# Wordlists Configuration Schema
|
||||
# Defines structure for banned words and domain whitelists
|
||||
|
||||
banned_words:
|
||||
type: object
|
||||
description: "Banned words and patterns configuration"
|
||||
properties:
|
||||
global_patterns:
|
||||
type: array
|
||||
description: "Patterns applied to all guilds (unless overridden)"
|
||||
items:
|
||||
type: object
|
||||
required: [pattern, action]
|
||||
properties:
|
||||
pattern:
|
||||
type: string
|
||||
description: "Word or regex pattern to match"
|
||||
minLength: 1
|
||||
maxLength: 200
|
||||
action:
|
||||
type: string
|
||||
enum: [delete, warn, strike, timeout]
|
||||
description: "Action to take when pattern matches"
|
||||
is_regex:
|
||||
type: boolean
|
||||
description: "Whether pattern is a regular expression"
|
||||
default: false
|
||||
reason:
|
||||
type: string
|
||||
description: "Reason for this rule"
|
||||
maxLength: 500
|
||||
category:
|
||||
type: string
|
||||
description: "Category of banned content"
|
||||
enum: [profanity, hate_speech, spam, scam, harassment, sexual, violence]
|
||||
severity:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 10
|
||||
description: "Severity level (1-10)"
|
||||
default: 5
|
||||
enabled:
|
||||
type: boolean
|
||||
description: "Whether this rule is active"
|
||||
default: true
|
||||
|
||||
guild_patterns:
|
||||
type: object
|
||||
description: "Guild-specific pattern overrides"
|
||||
patternProperties:
|
||||
"^[0-9]+$": # Guild ID
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required: [pattern, action]
|
||||
properties:
|
||||
pattern:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 200
|
||||
action:
|
||||
type: string
|
||||
enum: [delete, warn, strike, timeout]
|
||||
is_regex:
|
||||
type: boolean
|
||||
default: false
|
||||
reason:
|
||||
type: string
|
||||
maxLength: 500
|
||||
category:
|
||||
type: string
|
||||
enum: [profanity, hate_speech, spam, scam, harassment, sexual, violence]
|
||||
severity:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 10
|
||||
default: 5
|
||||
enabled:
|
||||
type: boolean
|
||||
default: true
|
||||
override_global:
|
||||
type: boolean
|
||||
description: "Whether this rule overrides global patterns"
|
||||
default: false
|
||||
|
||||
external_sources:
|
||||
type: object
|
||||
description: "External wordlist sources configuration"
|
||||
properties:
|
||||
sources:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required: [name, url, category, action]
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description: "Unique identifier for this source"
|
||||
pattern: "^[a-zA-Z0-9_-]+$"
|
||||
url:
|
||||
type: string
|
||||
description: "URL to fetch wordlist from"
|
||||
format: uri
|
||||
category:
|
||||
type: string
|
||||
enum: [profanity, hate_speech, spam, scam, harassment, sexual, violence]
|
||||
action:
|
||||
type: string
|
||||
enum: [delete, warn, strike, timeout]
|
||||
reason:
|
||||
type: string
|
||||
description: "Default reason for words from this source"
|
||||
enabled:
|
||||
type: boolean
|
||||
default: true
|
||||
update_interval_hours:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 8760 # 1 year
|
||||
description: "How often to update from source"
|
||||
default: 168 # 1 week
|
||||
applies_to_guilds:
|
||||
type: array
|
||||
description: "Guild IDs to apply this source to (empty = all guilds)"
|
||||
items:
|
||||
type: integer
|
||||
minimum: 1
|
||||
default: []
|
||||
|
||||
domain_allowlists:
|
||||
type: object
|
||||
description: "Domain whitelist configuration"
|
||||
properties:
|
||||
global_allowlist:
|
||||
type: array
|
||||
description: "Domains allowed for all guilds"
|
||||
items:
|
||||
type: object
|
||||
required: [domain]
|
||||
properties:
|
||||
domain:
|
||||
type: string
|
||||
description: "Domain name to allow"
|
||||
pattern: "^[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
|
||||
reason:
|
||||
type: string
|
||||
description: "Why this domain is allowed"
|
||||
added_by:
|
||||
type: string
|
||||
description: "Who added this domain"
|
||||
added_date:
|
||||
type: string
|
||||
format: date-time
|
||||
description: "When this domain was added"
|
||||
|
||||
guild_allowlists:
|
||||
type: object
|
||||
description: "Guild-specific domain allowlists"
|
||||
patternProperties:
|
||||
"^[0-9]+$": # Guild ID
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required: [domain]
|
||||
properties:
|
||||
domain:
|
||||
type: string
|
||||
pattern: "^[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
|
||||
reason:
|
||||
type: string
|
||||
added_by:
|
||||
type: string
|
||||
added_date:
|
||||
type: string
|
||||
format: date-time
|
||||
Reference in New Issue
Block a user