From 2dff13687df667febec971fb5323548c815d90f7 Mon Sep 17 00:00:00 2001 From: Valerie Date: Fri, 13 Jun 2025 19:40:33 -0400 Subject: [PATCH] Update ControlPanel to send embed messages to the associated text channel This update modifies the ControlPanel class to retrieve the associated text channel for the AutoRoom and send the embed message there, improving the clarity and functionality of the control panel interactions. The change ensures that messages are sent to the correct channel, enhancing user experience. --- autoroom/control_panel.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/autoroom/control_panel.py b/autoroom/control_panel.py index 4eb49f7..50a96da 100644 --- a/autoroom/control_panel.py +++ b/autoroom/control_panel.py @@ -205,6 +205,11 @@ class ControlPanel: if not owner: return + # Get the associated text channel + text_channel = autoroom.guild.get_channel(autoroom.id) + if not text_channel: + return + # Create the embed embed = discord.Embed( title="AutoRoom Control Panel", @@ -222,7 +227,7 @@ class ControlPanel: # Create view with buttons view = ControlPanelView(self.cog, autoroom.id) - # Send the embed - message = await autoroom.send(embed=embed, view=view) + # Send the embed to the text channel + message = await text_channel.send(embed=embed, view=view) # Store the message ID for reference await self.config.channel(autoroom).control_panel_message_id.set(message.id) \ No newline at end of file