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, TextChannel, ThreadChannel } from 'discord.js'
import { openChannelInfo, SlashCommand } from '../utils/index.js'
import { AdminCommand, openChannelInfo, SlashCommand } from '../utils/index.js'
export const PrivateThreadCreate: SlashCommand = {
name: 'private-thread',
@@ -9,7 +9,7 @@ export const PrivateThreadCreate: SlashCommand = {
run: async (client: Client, interaction: CommandInteraction) => {
// fetch the channel
const channel = await client.channels.fetch(interaction.channelId)
if (!channel || channel.type !== ChannelType.GuildText) return
if (!channel || !AdminCommand.includes(channel.type)) return
const thread = await (channel as TextChannel).threads.create({
name: `${client.user?.username}-private-support-${Date.now()}`,