diff options
Diffstat (limited to 'arthur')
| -rw-r--r-- | arthur/__main__.py | 2 | ||||
| -rw-r--r-- | arthur/apis/cloudflare/zones.py | 2 | ||||
| -rw-r--r-- | arthur/config.py | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/arthur/__main__.py b/arthur/__main__.py index d5cfffd..53e1fb3 100644 --- a/arthur/__main__.py +++ b/arthur/__main__.py @@ -31,7 +31,7 @@ async def main() -> None: intents=intents, ) async with arthur.instance as bot: - await bot.start(CONFIG.token) + await bot.start(CONFIG.token.get_secret_value()) with arthur.logger.catch(): diff --git a/arthur/apis/cloudflare/zones.py b/arthur/apis/cloudflare/zones.py index 1139d25..4e017f8 100644 --- a/arthur/apis/cloudflare/zones.py +++ b/arthur/apis/cloudflare/zones.py @@ -4,7 +4,7 @@ import aiohttp from arthur.config import CONFIG -AUTH_HEADER = {"Authorization": f"Bearer {CONFIG.cloudflare_token}"} +AUTH_HEADER = {"Authorization": f"Bearer {CONFIG.cloudflare_token.get_secret_value()}"} async def list_zones( diff --git a/arthur/config.py b/arthur/config.py index 66e89a7..9743667 100644 --- a/arthur/config.py +++ b/arthur/config.py @@ -1,5 +1,6 @@ """Utilities for interacting with the config for King Arthur.""" +import pydantic from pydantic_settings import BaseSettings @@ -12,7 +13,7 @@ class Config( """Configuration for King Arthur.""" # Discord bot token - token: str + token: pydantic.SecretStr # Discord bot prefix prefixes: tuple[str, ...] = ("arthur ", "M-x ") @@ -21,7 +22,7 @@ class Config( devops_role: int = 409416496733880320 # Token for authorising with the Cloudflare API - cloudflare_token: str + cloudflare_token: pydantic.SecretStr # Guild id guild_id: int = 267624335836053506 |