-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
44 lines (33 loc) · 1.02 KB
/
config.py
File metadata and controls
44 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
config.py – Loads all settings from the .env file.
"""
import os
from dotenv import load_dotenv
load_dotenv()
def _require(key: str) -> str:
val = os.getenv(key)
if not val:
raise RuntimeError(f"Missing required environment variable: {key}")
return val
def _int(key: str) -> int:
return int(_require(key))
BOT_TOKEN: str = _require("BOT_TOKEN")
SOURCE_GUILD_ID: int = _int("SOURCE_GUILD_ID")
SOURCE_CHANNEL_ID: int = _int("SOURCE_CHANNEL_ID")
SOURCE_USER_ID: int = _int("SOURCE_USER_ID")
TARGETS: list[dict] = [
{
"guild_id": _int("TARGET_1_GUILD_ID"),
"channel_id": _int("TARGET_1_CHANNEL_ID"),
},
{
"guild_id": _int("TARGET_2_GUILD_ID"),
"channel_id": _int("TARGET_2_CHANNEL_ID"),
},
{
"guild_id": _int("TARGET_3_GUILD_ID"),
"channel_id": _int("TARGET_3_CHANNEL_ID"),
},
]
JITTER_BUFFER_FRAMES: int = int(os.getenv("JITTER_BUFFER_FRAMES", "2"))
MAX_QUEUE_FRAMES: int = int(os.getenv("MAX_QUEUE_FRAMES", "100"))