From fa1c30d8edacfafc46b9ba0d87e1580516608e65 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Fri, 15 Apr 2022 03:47:25 +0100 Subject: [PATCH] Refactor twitch link into constant --- exclamation_mark_charity/__init__.py | 2 ++ exclamation_mark_charity/runner.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/exclamation_mark_charity/__init__.py b/exclamation_mark_charity/__init__.py index 56a959b..b41dc41 100644 --- a/exclamation_mark_charity/__init__.py +++ b/exclamation_mark_charity/__init__.py @@ -20,6 +20,8 @@ DB_FILE.parent.mkdir(parents=True, exist_ok=True) LOG_FILE = Path("logs", "discord.log") LOG_FILE.parent.mkdir(parents=True, exist_ok=True) +TWITCH_CHANNEL = "https://www.twitch.tv/exclamation_mark_charity" + # Set Up Logging LOGGER = logging.getLogger("discord") LOGGER.setLevel(logging.DEBUG) diff --git a/exclamation_mark_charity/runner.py b/exclamation_mark_charity/runner.py index 42ad79a..6cb1433 100644 --- a/exclamation_mark_charity/runner.py +++ b/exclamation_mark_charity/runner.py @@ -1,7 +1,7 @@ from discord import Intents, Streaming from discord.ext.commands import Context, Bot -from exclamation_mark_charity import BOT_PREFIX, BOT_TOKEN, HAMMY, NUGGS, LUCA +from exclamation_mark_charity import BOT_PREFIX, BOT_TOKEN, HAMMY, NUGGS, LUCA, TWITCH_CHANNEL bot = Bot( command_prefix=BOT_PREFIX, @@ -9,7 +9,7 @@ bot = Bot( help_command=None, owner_ids=(HAMMY, NUGGS, LUCA) ) -bot.activity = Streaming(name="!charity", url="https://www.twitch.tv/exclamation_mark_charity") +bot.activity = Streaming(name="!charity", url=TWITCH_CHANNEL) @bot.command()