diff --git a/scnewsbot/extensions/announcements.py b/scnewsbot/extensions/announcements.py index 69f565d..7f9bfc2 100644 --- a/scnewsbot/extensions/announcements.py +++ b/scnewsbot/extensions/announcements.py @@ -7,7 +7,6 @@ import discord from utils import can_publish_announcements ANNOUNCEMENT_BUILDER_TIMEOUT = 1200 -EMBED_COLOR = 0x1ABC9C EMBED_THUMBNAIL = "https://imgur.com/MJnM3LU.png" @@ -143,7 +142,7 @@ class Announcement: async def get_embed(self, *, bot: commands.Bot) -> discord.Embed: embed = discord.Embed( - color=EMBED_COLOR, + color=bot.config.embed_color, title=self.title, url=self.url, description=self.description, diff --git a/scnewsbot/extensions/templates.py b/scnewsbot/extensions/templates.py index 88f99a0..e98aa23 100644 --- a/scnewsbot/extensions/templates.py +++ b/scnewsbot/extensions/templates.py @@ -2,8 +2,6 @@ from discord.ext import commands import discord from extensions.announcements import Announcement -EMBED_COLOR = 0x1ABC9C - TEMPLATES: dict[str, Announcement] = { "isc": Announcement(title="Inside Star Citizen | [topic] - [subtopic]"), "scl": Announcement(title="Star Citizen Live | [topic] - [subtopic]"), @@ -90,13 +88,17 @@ class TemplatesCog(commands.Cog, name="Templates"): @commands.command(name="previews", brief="Shows all the possible ping previews.") async def ping_previews(self, ctx: commands.Context) -> None: await ctx.reply( - embed=discord.Embed(color=EMBED_COLOR, description=PING_PREVIEWS), + embed=discord.Embed( + color=self.bot.config.embed_color, description=PING_PREVIEWS + ), allowed_mentions=discord.AllowedMentions.none(), ) @commands.command(brief="Shows all the channel IDs for announcements.") async def channels(self, ctx: commands.Context) -> None: - await ctx.reply(embed=discord.Embed(color=EMBED_COLOR, description=CHANNELS)) + await ctx.reply( + embed=discord.Embed(color=self.bot.config.embed_color, description=CHANNELS) + ) async def setup(bot: commands.Bot) -> None: diff --git a/scnewsbot/utils.py b/scnewsbot/utils.py index ec7ecef..aee7fb1 100644 --- a/scnewsbot/utils.py +++ b/scnewsbot/utils.py @@ -5,6 +5,10 @@ class Config: def __init__(self, config: dict): self.config = config + @property + def embed_color(self) -> int: + return 0x1ABC9C + @property def debug(self) -> bool: return self.config.get("debug", False)