diff options
Diffstat (limited to 'arthur/exts')
| -rw-r--r-- | arthur/exts/grafana/github_team_sync.py | 6 | ||||
| -rw-r--r-- | arthur/exts/grafana/ldap_team_sync.py | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/arthur/exts/grafana/github_team_sync.py b/arthur/exts/grafana/github_team_sync.py index 6e77a55..7bc6144 100644 --- a/arthur/exts/grafana/github_team_sync.py +++ b/arthur/exts/grafana/github_team_sync.py @@ -4,6 +4,7 @@ from discord.ext import commands, tasks from arthur.apis import github, grafana from arthur.bot import KingArthur +from arthur.config import CONFIG from arthur.log import logger from . import MissingMembers, SyncFigures @@ -156,4 +157,9 @@ class GrafanaGitHubTeamSync(commands.Cog): async def setup(bot: KingArthur) -> None: """Add cog to bot.""" + if CONFIG.grafana_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)) diff --git a/arthur/exts/grafana/ldap_team_sync.py b/arthur/exts/grafana/ldap_team_sync.py index 2d63099..f8b3ab0 100644 --- a/arthur/exts/grafana/ldap_team_sync.py +++ b/arthur/exts/grafana/ldap_team_sync.py @@ -168,11 +168,11 @@ class GrafanaLDAPTeamSync(commands.Cog): async def setup(bot: KingArthur) -> None: """Add cog to bot.""" - if ldap.BONSAI_AVAILABLE and CONFIG.enable_ldap: + if ldap.BONSAI_AVAILABLE and CONFIG.enable_ldap and CONFIG.grafana_token: await bot.add_cog(GrafanaLDAPTeamSync(bot)) else: logger.warning( "Not loading Grafana LDAP team sync as LDAP dependencies " - "LDAP dependencies are not installed or LDAP is disabled," - " see README.md for more" + "LDAP dependencies are not installed, LDAP is disabled," + " or grafana_token not set. See README.md for more" ) |