-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.py
38 lines (30 loc) · 821 Bytes
/
config.py
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
from dataclasses import dataclass
from environs import Env
@dataclass(frozen=True)
class Config:
lang: str
token: str
main_chat: int
admin_chat: int
google_api_key: str
channel_name: str
channel_url: str
channel_id: str
update_interval: int
rules_file: str
welcome_file: str
env = Env()
env.read_env(override=True)
config = Config(
lang=env.str("LANG", default="ru"),
token=env.str("TOKEN"),
main_chat=env.int("MAIN_CHAT"),
admin_chat=env.int("ADMIN_CHAT"),
google_api_key=env.str("GOOGLE_API_KEY"),
channel_name=env.str("CHANNEL_NAME"),
channel_url=env.str("CHANNEL_URL"),
channel_id=env.str("CHANNEL_ID"),
update_interval=env.int("UPDATE_INTERVAL"),
rules_file=env.str("RULES_FILE"),
welcome_file=env.str("WELCOME_FILE")
)