Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
FuseFairy committed Apr 21, 2024
1 parent 4901af6 commit c35e4a8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/check_channel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import discord
import os
from dotenv import load_dotenv

load_dotenv()

async def check_channel(interaction: discord.Interaction, channel):
allowed_channel_ids = os.getenv(channel, "").split(",")
if str(interaction.channel.id) not in allowed_channel_ids and allowed_channel_ids[0] != "":
allowed_channels_mention = ", ".join(f"<#{id_}>" for id_ in allowed_channel_ids)
await interaction.followup.send(f"> **Command can only be used on: {allowed_channels_mention}**")
return False
return True

0 comments on commit c35e4a8

Please sign in to comment.