Pull/Switch Model Commands Fix (#137)

* Update: Channel checker and channel name gone

* Add: note of where problem can be

* Update: Check if model already exists for Pull Command

* Add: User/Admin Command Constants

* Update: version increment
This commit is contained in:
Kevin Dang
2024-11-08 20:09:01 -08:00
committed by GitHub
parent 1ccd1a012e
commit 33152b33f3
15 changed files with 67 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
import { ChannelType, Client, CommandInteraction, ApplicationCommandOptionType } from 'discord.js'
import { openConfig, SlashCommand } from '../utils/index.js'
import { AdminCommand, openConfig, SlashCommand } from '../utils/index.js'
export const Disable: SlashCommand = {
name: 'toggle-chat',
@@ -19,7 +19,7 @@ export const Disable: SlashCommand = {
run: async (client: Client, interaction: CommandInteraction) => {
// fetch channel and message
const channel = await client.channels.fetch(interaction.channelId)
if (!channel || channel.type !== ChannelType.GuildText) return
if (!channel || !AdminCommand.includes(channel.type)) return
// check if runner is an admin
if (!interaction.memberPermissions?.has('Administrator')) {