From 202252c1779b14e88619fb591c1f0cd9ff9d182c Mon Sep 17 00:00:00 2001 From: zeragonii Date: Sun, 20 Oct 2024 09:16:31 +0000 Subject: [PATCH] added name resolve to channel ID --- bot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 62387d0..2e2f846 100644 --- a/bot.py +++ b/bot.py @@ -66,11 +66,15 @@ async def on_ready(): private="Should the thread be private?" ) async def lfm(interaction: discord.Interaction, type: str, dungeon: str, level: int, private: bool = False): - # Verify the command is being used in the correct channel + # The ID of the allowed channel allowed_channel_id = 1297217492699320462 # Replace this with the correct channel ID + + # Fetch the allowed channel by ID and resolve its name + allowed_channel = bot.get_channel(allowed_channel_id) + if interaction.channel.id != allowed_channel_id: await interaction.response.send_message( - f"This command can only be used in the specific channel (ID: {allowed_channel_id}).", + f"This command can only be used in **#{allowed_channel.name}**.", ephemeral=True ) return # Exit the command if the channel ID does not match