Notion_Bot/app/settings.py

26 lines
584 B
Python
Raw Normal View History

2024-04-27 21:42:08 +04:00
import os
from typing import Union
from aiogram import Bot
from notion_client import AsyncClient
from pydantic import SecretStr
from pydantic_settings import BaseSettings
class Secrets(BaseSettings):
token: SecretStr
admin_id: Union[SecretStr.get_secret_value, int]
notion_token: SecretStr
imgur_client_id: SecretStr
database_id: SecretStr
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
secrets = Secrets()
notion = AsyncClient(auth=secrets.notion_token.get_secret_value())
bot = Bot(token=secrets.token.get_secret_value())