ThreadChannel.setName and .setLocked issue

Trying to set a thread's name and then lock it, but neither of these methods seem to work correctly.

setName works sporadically while setLocked nothing at all

Sample
if (channel.isThread()) {
    (await channel.setName('something')).setLocked();
}

Full command
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;
            }
        }
    }
}
Was this page helpful?