From 4300896cc205a72ea2973a670186f4029b6bfde3 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Mon, 19 Aug 2024 12:07:19 +0100 Subject: Allow loading the bot without a grafana_token set --- arthur/exts/grafana/github_team_sync.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arthur/exts/grafana/github_team_sync.py') 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)) -- cgit v1.2.3