# -*- coding: utf-8 -*-
from __future__ import annotations

from django.apps import AppConfig
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import gettext_lazy as _


class BotConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    label = 'bot'
    name = 'hotpocket_backend.apps.bot'
    verbose_name = _('Bot')

    def ready(self):
        super().ready()

        try:
            from hotpocket_backend.apps.bot import conf
            conf.bot_settings = conf.from_django_settings()
        except Exception as exception:
            raise ImproperlyConfigured('Invalid bot settings') from exception
