From efe85caf22b9f50cd8474c7f5bdbd77f596e061d Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 2 Mar 2023 13:44:27 -0500 Subject: [PATCH] made coco emoji configurable --- galaxy/galaxy.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/galaxy/galaxy.py b/galaxy/galaxy.py index c37222a..a484aa3 100644 --- a/galaxy/galaxy.py +++ b/galaxy/galaxy.py @@ -10,12 +10,13 @@ class Galaxy(commands.Cog): self.bot = bot self.config = Config.get_conf(self, identifier=6621962) self.config.register_guild( - cocotarget = 0 + cocotarget = 0, + cocoemoji = 1028535684757209118 ) @commands.Cog.listener('on_message') async def cocoreact(self, message): - emoji = self.bot.get_emoji(1028535684757209118) + emoji = self.bot.get_emoji(await self.config.guild(message.guild).cocoemoji()) cocotarget = await self.config.guild(message.guild).cocotarget() if cocotarget == 0: return @@ -28,9 +29,20 @@ class Galaxy(commands.Cog): async def coco(self, ctx): """Checks who Coco is currently set to.""" cocotarget = await self.config.guild(ctx.guild).cocotarget() - embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco is currently set to <@{cocotarget}> ({cocotarget}).") + embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco is currently set to <@{cocotarget}> ({cocotarget}).\nCoco's emoji is currently set to ") await ctx.send(embed=embed) + @coco.command(name="emoji") + @checks.is_owner() + async def coco_emoji_set(self, ctx, emoji: discord.Emoji): + """Sets Coco's emoji.""" + if emoji: + await self.config.guild(ctx.guild).cocotarget.set(emoji.id) + embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco's emoji has been set to {emoji} ({emoji.id}).") + await ctx.send(embed=embed) + else: + await ctx.send(content="That is not a valid argument!") + @coco.command(name="set") @checks.is_owner() async def coco_set(self, ctx, member: discord.Member):