models ¶
Pydantic configuration models for Tux.
This module contains all the Pydantic models for configuration, extracted from the existing config.py file for better organization.
Classes:
-
BotInfo–Bot information configuration.
-
UserIds–User ID configuration.
-
StatusRoles–Status roles configuration.
-
TempVC–Temporary voice channel configuration.
-
GifLimiter–GIF limiter configuration.
-
XP–XP system configuration.
-
Snippets–Snippets configuration.
-
IRC–IRC bridge configuration.
-
ExternalServices–External services configuration.
-
DatabaseConfig–Database configuration with automatic URL construction.
Classes¶
BotInfo pydantic-model ¶
Bases: BaseModel
Bot information configuration.
Show JSON schema:
{
"description": "Bot information configuration.",
"properties": {
"BOT_NAME": {
"default": "Tux",
"description": "Name of the bot",
"title": "Bot Name",
"type": "string"
},
"ACTIVITIES": {
"default": "[]",
"description": "Bot activities",
"title": "Activities",
"type": "string"
},
"HIDE_BOT_OWNER": {
"default": false,
"description": "Hide bot owner info",
"title": "Hide Bot Owner",
"type": "boolean"
},
"PREFIX": {
"default": "$",
"description": "Command prefix",
"title": "Prefix",
"type": "string"
}
},
"title": "BotInfo",
"type": "object"
}
Fields:
-
BOT_NAME(str) -
ACTIVITIES(str) -
HIDE_BOT_OWNER(bool) -
PREFIX(str)
Attributes¶
UserIds pydantic-model ¶
Bases: BaseModel
User ID configuration.
Show JSON schema:
{
"description": "User ID configuration.",
"properties": {
"BOT_OWNER_ID": {
"default": 0,
"description": "Bot owner user ID",
"title": "Bot Owner Id",
"type": "integer"
},
"SYSADMINS": {
"description": "System admin user IDs",
"items": {
"type": "integer"
},
"title": "Sysadmins",
"type": "array"
}
},
"title": "UserIds",
"type": "object"
}
Fields:
-
BOT_OWNER_ID(int) -
SYSADMINS(list[int])
StatusRoles pydantic-model ¶
Bases: BaseModel
Status roles configuration.
Show JSON schema:
{
"description": "Status roles configuration.",
"properties": {
"MAPPINGS": {
"description": "Status to role mappings",
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Mappings",
"type": "array"
}
},
"title": "StatusRoles",
"type": "object"
}
Fields:
TempVC pydantic-model ¶
Bases: BaseModel
Temporary voice channel configuration.
Show JSON schema:
{
"description": "Temporary voice channel configuration.",
"properties": {
"TEMPVC_CHANNEL_ID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Temporary VC channel ID",
"title": "Tempvc Channel Id"
},
"TEMPVC_CATEGORY_ID": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Temporary VC category ID",
"title": "Tempvc Category Id"
}
},
"title": "TempVC",
"type": "object"
}
Fields:
-
TEMPVC_CHANNEL_ID(str | None) -
TEMPVC_CATEGORY_ID(str | None)
GifLimiter pydantic-model ¶
Bases: BaseModel
GIF limiter configuration.
Show JSON schema:
{
"description": "GIF limiter configuration.",
"properties": {
"RECENT_GIF_AGE": {
"default": 60,
"description": "Recent GIF age limit",
"title": "Recent Gif Age",
"type": "integer"
},
"GIF_LIMITS_USER": {
"additionalProperties": {
"type": "integer"
},
"description": "User GIF limits",
"title": "Gif Limits User",
"type": "object"
},
"GIF_LIMITS_CHANNEL": {
"additionalProperties": {
"type": "integer"
},
"description": "Channel GIF limits",
"title": "Gif Limits Channel",
"type": "object"
},
"GIF_LIMIT_EXCLUDE": {
"description": "Excluded channels",
"items": {
"type": "integer"
},
"title": "Gif Limit Exclude",
"type": "array"
}
},
"title": "GifLimiter",
"type": "object"
}
Fields:
-
RECENT_GIF_AGE(int) -
GIF_LIMITS_USER(dict[int, int]) -
GIF_LIMITS_CHANNEL(dict[int, int]) -
GIF_LIMIT_EXCLUDE(list[int])
Attributes¶
XP pydantic-model ¶
Bases: BaseModel
XP system configuration.
Show JSON schema:
{
"description": "XP system configuration.",
"properties": {
"XP_BLACKLIST_CHANNELS": {
"description": "XP blacklist channels",
"items": {
"type": "integer"
},
"title": "Xp Blacklist Channels",
"type": "array"
},
"XP_ROLES": {
"description": "XP roles",
"items": {
"additionalProperties": {
"type": "integer"
},
"type": "object"
},
"title": "Xp Roles",
"type": "array"
},
"XP_MULTIPLIERS": {
"description": "XP multipliers",
"items": {
"additionalProperties": {
"anyOf": [
{
"type": "integer"
},
{
"type": "number"
}
]
},
"type": "object"
},
"title": "Xp Multipliers",
"type": "array"
},
"XP_COOLDOWN": {
"default": 1,
"description": "XP cooldown in seconds",
"title": "Xp Cooldown",
"type": "integer"
},
"LEVELS_EXPONENT": {
"default": 2,
"description": "Levels exponent",
"title": "Levels Exponent",
"type": "integer"
},
"SHOW_XP_PROGRESS": {
"default": true,
"description": "Show XP progress",
"title": "Show Xp Progress",
"type": "boolean"
},
"ENABLE_XP_CAP": {
"default": false,
"description": "Enable XP cap",
"title": "Enable Xp Cap",
"type": "boolean"
}
},
"title": "XP",
"type": "object"
}
Fields:
-
XP_BLACKLIST_CHANNELS(list[int]) -
XP_ROLES(list[dict[str, int]]) -
XP_MULTIPLIERS(list[dict[str, int | float]]) -
XP_COOLDOWN(int) -
LEVELS_EXPONENT(int) -
SHOW_XP_PROGRESS(bool) -
ENABLE_XP_CAP(bool)
Attributes¶
Snippets pydantic-model ¶
Bases: BaseModel
Snippets configuration.
Show JSON schema:
{
"description": "Snippets configuration.",
"properties": {
"LIMIT_TO_ROLE_IDS": {
"default": false,
"description": "Limit snippets to specific roles",
"title": "Limit To Role Ids",
"type": "boolean"
},
"ACCESS_ROLE_IDS": {
"description": "Snippet access role IDs",
"items": {
"type": "integer"
},
"title": "Access Role Ids",
"type": "array"
}
},
"title": "Snippets",
"type": "object"
}
Fields:
IRC pydantic-model ¶
Bases: BaseModel
IRC bridge configuration.
Show JSON schema:
{
"description": "IRC bridge configuration.",
"properties": {
"BRIDGE_WEBHOOK_IDS": {
"description": "IRC bridge webhook IDs",
"items": {
"type": "integer"
},
"title": "Bridge Webhook Ids",
"type": "array"
}
},
"title": "IRC",
"type": "object"
}
Fields:
ExternalServices pydantic-model ¶
Bases: BaseModel
External services configuration.
Show JSON schema:
{
"description": "External services configuration.",
"properties": {
"SENTRY_DSN": {
"default": "",
"description": "Sentry DSN",
"title": "Sentry Dsn",
"type": "string"
},
"GITHUB_APP_ID": {
"default": "",
"description": "GitHub app ID",
"title": "Github App Id",
"type": "string"
},
"GITHUB_INSTALLATION_ID": {
"default": "",
"description": "GitHub installation ID",
"title": "Github Installation Id",
"type": "string"
},
"GITHUB_PRIVATE_KEY": {
"default": "",
"description": "GitHub private key",
"title": "Github Private Key",
"type": "string"
},
"GITHUB_CLIENT_ID": {
"default": "",
"description": "GitHub client ID",
"title": "Github Client Id",
"type": "string"
},
"GITHUB_CLIENT_SECRET": {
"default": "",
"description": "GitHub client secret",
"title": "Github Client Secret",
"type": "string"
},
"GITHUB_REPO_URL": {
"default": "",
"description": "GitHub repository URL",
"title": "Github Repo Url",
"type": "string"
},
"GITHUB_REPO_OWNER": {
"default": "",
"description": "GitHub repository owner",
"title": "Github Repo Owner",
"type": "string"
},
"GITHUB_REPO": {
"default": "",
"description": "GitHub repository name",
"title": "Github Repo",
"type": "string"
},
"MAILCOW_API_KEY": {
"default": "",
"description": "Mailcow API key",
"title": "Mailcow Api Key",
"type": "string"
},
"MAILCOW_API_URL": {
"default": "",
"description": "Mailcow API URL",
"title": "Mailcow Api Url",
"type": "string"
},
"WOLFRAM_APP_ID": {
"default": "",
"description": "Wolfram Alpha app ID",
"title": "Wolfram App Id",
"type": "string"
},
"INFLUXDB_TOKEN": {
"default": "",
"description": "InfluxDB token",
"title": "Influxdb Token",
"type": "string"
},
"INFLUXDB_URL": {
"default": "",
"description": "InfluxDB URL",
"title": "Influxdb Url",
"type": "string"
},
"INFLUXDB_ORG": {
"default": "",
"description": "InfluxDB organization",
"title": "Influxdb Org",
"type": "string"
}
},
"title": "ExternalServices",
"type": "object"
}
Fields:
-
SENTRY_DSN(str) -
GITHUB_APP_ID(str) -
GITHUB_INSTALLATION_ID(str) -
GITHUB_PRIVATE_KEY(str) -
GITHUB_CLIENT_ID(str) -
GITHUB_CLIENT_SECRET(str) -
GITHUB_REPO_URL(str) -
GITHUB_REPO_OWNER(str) -
GITHUB_REPO(str) -
MAILCOW_API_KEY(str) -
MAILCOW_API_URL(str) -
WOLFRAM_APP_ID(str) -
INFLUXDB_TOKEN(str) -
INFLUXDB_URL(str) -
INFLUXDB_ORG(str)
DatabaseConfig pydantic-model ¶
Bases: BaseModel
Database configuration with automatic URL construction.
Show JSON schema:
{
"description": "Database configuration with automatic URL construction.",
"properties": {
"POSTGRES_HOST": {
"default": "localhost",
"description": "PostgreSQL host",
"title": "Postgres Host",
"type": "string"
},
"POSTGRES_PORT": {
"default": 5432,
"description": "PostgreSQL port",
"title": "Postgres Port",
"type": "integer"
},
"POSTGRES_DB": {
"default": "tuxdb",
"description": "PostgreSQL database name",
"title": "Postgres Db",
"type": "string"
},
"POSTGRES_USER": {
"default": "tuxuser",
"description": "PostgreSQL username",
"title": "Postgres User",
"type": "string"
},
"POSTGRES_PASSWORD": {
"default": "tuxpass",
"description": "PostgreSQL password",
"title": "Postgres Password",
"type": "string"
},
"DATABASE_URL": {
"default": "",
"description": "Custom database URL override",
"title": "Database Url",
"type": "string"
}
},
"title": "DatabaseConfig",
"type": "object"
}
Fields: