From d856b74d1cb3002132b7a68fb47783d45c2d5d28 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Tue, 13 Aug 2024 23:00:43 +0100 Subject: [PATCH] Fix the format breaking the match print again --- py/cogs/matchy_cog.py | 10 ++++++---- py/matchy.py | 2 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/py/cogs/matchy_cog.py b/py/cogs/matchy_cog.py index 3398e97..b7dd0ee 100644 --- a/py/cogs/matchy_cog.py +++ b/py/cogs/matchy_cog.py @@ -7,7 +7,7 @@ from discord import app_commands from discord.ext import commands, tasks from datetime import datetime, timedelta, time -import match_button +import cogs.match_button as match_button import matching from state import State, save_to_file, AuthScope import util @@ -25,6 +25,7 @@ class MatchyCog(commands.Cog): async def on_ready(self): """Bot is ready and connected""" self.run_hourly_tasks.start() + self.bot.add_dynamic_items(match_button.DynamicGroupButton) activity = discord.Game("/join") await self.bot.change_presence(status=discord.Status.online, activity=activity) logger.info("Bot is up and ready!") @@ -79,7 +80,8 @@ class MatchyCog(commands.Cog): logger.info("Handling /list command in %s %s from %s", interaction.guild.name, interaction.channel, interaction.user.name) - matchees = matching.get_matchees_in_channel(self.state, interaction.channel) + matchees = matching.get_matchees_in_channel( + self.state, interaction.channel) mentions = [m.mention for m in matchees] msg = "Current matchees in this channel:\n" + \ f"{util.format_list(mentions)}" @@ -186,7 +188,7 @@ class MatchyCog(commands.Cog): else: # Let a non-matcher know why they don't have the button msg += f"\n\nYou'll need the {AuthScope.MATCHER}" - + " scope to post this to the channel, sorry!" + msg += " scope to post this to the channel, sorry!" await interaction.response.send_message(msg, ephemeral=True, silent=True, view=view) @@ -195,7 +197,7 @@ class MatchyCog(commands.Cog): @tasks.loop(time=[time(hour=h) for h in range(24)]) async def run_hourly_tasks(self): """Run any hourly tasks we have""" - + for (channel, min) in self.state.get_active_match_tasks(): logger.info("Scheduled match task triggered in %s", channel) msg_channel = self.bot.get_channel(int(channel)) diff --git a/py/matchy.py b/py/matchy.py index e0a688a..c40559c 100755 --- a/py/matchy.py +++ b/py/matchy.py @@ -27,8 +27,6 @@ bot = commands.Bot(command_prefix='$', async def setup_hook(): await bot.add_cog(MatchyCog(bot, State)) await bot.add_cog(OwnerCog(bot)) - # TODO: This line feels like it should be in the cog? - bot.add_dynamic_items(match_button.DynamicGroupButton) @bot.event