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:
@@ -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()}`,
|
||||
|
||||
Reference in New Issue
Block a user