diff --git a/reinhard/config.py b/reinhard/config.py index adf313a..c224ade 100644 --- a/reinhard/config.py +++ b/reinhard/config.py @@ -229,12 +229,10 @@ def from_env(cls) -> Self: dotenv.load_dotenv() return cls( - # pyright bug - cache=_cast_or_else(os.environ, "CACHE", hikari.api.CacheComponents, DEFAULT_CACHE), # type: ignore + cache=_cast_or_else(os.environ, "CACHE", hikari.api.CacheComponents, DEFAULT_CACHE), database=DatabaseConfig.from_env(), emoji_guild=_cast_or_else(os.environ, "EMOJI_GUILD", hikari.Snowflake, None), - # pyright bug - intents=_cast_or_else(os.environ, "INTENTS", hikari.Intents, DEFAULT_INTENTS), # type: ignore + intents=_cast_or_else(os.environ, "INTENTS", hikari.Intents, DEFAULT_INTENTS), log_level=_cast_or_else(os.environ, "LOG_LEVEL", lambda v: int(v) if v.isdigit() else v, logging.INFO), mention_prefix=_cast_or_else(os.environ, "MENTION_PREFIX", _str_to_bool, True), owner_only=_cast_or_else(os.environ, "OWNER_ONLY", _str_to_bool, False), @@ -265,12 +263,10 @@ def from_mapping(cls, mapping: collections.Mapping[str, typing.Any], /) -> Self: declare_global_commands = hikari.Snowflake(declare_global_commands) return cls( - # pyright bug - cache=_cast_or_else(mapping, "cache", hikari.api.CacheComponents, DEFAULT_CACHE), # type: ignore + cache=_cast_or_else(mapping, "cache", hikari.api.CacheComponents, DEFAULT_CACHE), database=DatabaseConfig.from_mapping(mapping["database"]), emoji_guild=_cast_or_else(mapping, "emoji_guild", hikari.Snowflake, None), - # pyright Bug - intents=_cast_or_else(mapping, "intents", hikari.Intents, DEFAULT_INTENTS), # type: ignore + intents=_cast_or_else(mapping, "intents", hikari.Intents, DEFAULT_INTENTS), log_level=log_level, mention_prefix=bool(mapping.get("mention_prefix", True)), owner_only=bool(mapping.get("owner_only", False)),