module.exports = {
name: `thread`,
description: `Mark threads as solved or closed`,
cooldown: 0,
type: ApplicationCommandType.ChatInput,
options: [{
name: `option`,
description: `Chose to mark the thread as solved or closed`,
type: ApplicationCommandOptionType.String,
required: true,
choices: [{ name: 'Solved', value: 'solved' },
{ name: 'Closed', value: 'closed' }]
}],
async execute(interaction) {
const { options, channel } = interaction;
await interaction.deferReply({ ephemeral: true });
if (!channel.isThread()) {
return interaction.reply({
content: `This is not a thread channel`,
ephemeral: true
});
}
switch (options.getString('option')) {
case 'solved': {
(await channel.setName(`[SOLVED] ${channel.name}`)).setLocked();
interaction.editReply({
content: `Thread has been closed and marked as solved`,
ephemeral: true
});
break;
}
}
}
}
module.exports = {
name: `thread`,
description: `Mark threads as solved or closed`,
cooldown: 0,
type: ApplicationCommandType.ChatInput,
options: [{
name: `option`,
description: `Chose to mark the thread as solved or closed`,
type: ApplicationCommandOptionType.String,
required: true,
choices: [{ name: 'Solved', value: 'solved' },
{ name: 'Closed', value: 'closed' }]
}],
async execute(interaction) {
const { options, channel } = interaction;
await interaction.deferReply({ ephemeral: true });
if (!channel.isThread()) {
return interaction.reply({
content: `This is not a thread channel`,
ephemeral: true
});
}
switch (options.getString('option')) {
case 'solved': {
(await channel.setName(`[SOLVED] ${channel.name}`)).setLocked();
interaction.editReply({
content: `Thread has been closed and marked as solved`,
ephemeral: true
});
break;
}
}
}
}