Update ControlPanel to send embed messages to the associated text channel
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run

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.
This commit is contained in:
Valerie 2025-06-13 19:40:33 -04:00
parent 05db4e0d39
commit 2dff13687d

View file

@ -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)