Adjusted Slash Command Scope (#91)

* Update: Slash Command Scope

* Update: version increment
This commit is contained in:
Kevin Dang
2024-07-31 06:19:23 -07:00
committed by GitHub
parent 352d88ee9d
commit 060494e883
7 changed files with 8 additions and 9 deletions

View File

@@ -20,8 +20,7 @@ export const ChannelToggle: SlashCommand = {
run: async (client: Client, interaction: CommandInteraction) => {
// fetch channel location
const channel = await client.channels.fetch(interaction.channelId)
if (!channel || channel.type !== (ChannelType.PublicThread && ChannelType.GuildText)) return
if (!channel || channel.type !== (ChannelType.PrivateThread && ChannelType.PublicThread && ChannelType.GuildText)) return
// set state of bot channel preferences
openConfig(`${interaction.guildId}-config.json`, interaction.commandName, interaction.options.get('toggle-channel')?.value)