sfx-tg-bot/config/config.py

79 строки
1.3 KiB
Python

from configparser import RawConfigParser
config = RawConfigParser()
config.read(
filenames='./config.ini',
)
class Bot:
token = config.get(
section='Bot',
option='token',
)
class Database:
dbname = config.get(
section='Database',
option='dbname',
)
user = config.get(
section='Database',
option='user',
)
password = config.get(
section='Database',
option='password',
)
host = config.get(
section='Database',
option='host',
fallback='localhost',
)
port = config.getint(
section='Database',
option='port',
fallback=5432,
)
class AI:
enabled = config.getboolean(
section='AI',
option='enabled',
fallback=True,
)
k = config.getint(
section='AI',
option='k',
fallback=3,
)
update_frequency = config.getint(
section='AI',
option='update_frequency',
fallback=86400,
)
class Jira:
username = config.get(
section='Jira',
option='username',
)
token = config.get(
section='Jira',
option='token',
)
server = config.get(
section='Jira',
option='server',
)