diff options
author | 2024-08-19 12:08:02 +0100 | |
---|---|---|
committer | 2024-08-19 12:08:35 +0100 | |
commit | e429c8b0a9fb7c3f39079a7d30c4e10427b4f32e (patch) | |
tree | 88723b4280334a37df81c31e12eec57dc47eb9fa | |
parent | Allow loading the bot without a grafana_token set (diff) |
Allow loading the bot without a github_token set
-rw-r--r-- | arthur/config.py | 2 | ||||
-rw-r--r-- | arthur/exts/grafana/github_team_sync.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/arthur/config.py b/arthur/config.py index b1b1f2a..4d31103 100644 --- a/arthur/config.py +++ b/arthur/config.py @@ -21,7 +21,7 @@ class Config( youtube_api_key: pydantic.SecretStr | None = None grafana_url: str = "https://grafana.pydis.wtf" grafana_token: pydantic.SecretStr | None = None - github_token: pydantic.SecretStr + github_token: pydantic.SecretStr | None = None github_org: str = "python-discord" devops_role: int = 409416496733880320 diff --git a/arthur/exts/grafana/github_team_sync.py b/arthur/exts/grafana/github_team_sync.py index 7bc6144..43500cb 100644 --- a/arthur/exts/grafana/github_team_sync.py +++ b/arthur/exts/grafana/github_team_sync.py @@ -157,9 +157,9 @@ class GrafanaGitHubTeamSync(commands.Cog): async def setup(bot: KingArthur) -> None: """Add cog to bot.""" - if CONFIG.grafana_token: + if CONFIG.grafana_token and CONFIG.github_token: await bot.add_cog(GrafanaGitHubTeamSync(bot)) else: - logger.warning("Not loading Grafana Github team sync grafana_token not set") - - await bot.add_cog(GrafanaGitHubTeamSync(bot)) + logger.warning( + "Not loading Grafana Github team sync as grafana_token and/or github_token are not set" + ) |