#Impossible to edit channel name

6 messages · Page 1 of 1 (latest)

teal haven
#

hi, why with this code i have this error ? (sorry for my english im french)

module.exports = {
    description: "Verouille le salon",
    permissions: ["ManageChannels"],
    async run({ client, interaction }) {
        try {
            interaction.channel.permissionOverwrites.edit(interaction.guild.roles.everyone, {
                SendMessages: false
            })
        } catch {
            await interaction.reply({ content: `Je ne peux pas verouiller le salon`, ephemeral: true })
        }
        // try {
        const name = interaction.channel.name
        const newName = `🔒 ${name}`
        console.log(newName, typeof newName)
        // const channel = await interaction.guild.channels.fetch(interaction.channel.id)
        interaction.channel.setName({ name: newName })
        // } catch {}
        await interaction.reply({ content: `Le salon a bien été verouillé`, ephemeral: false })
    }
}```
warped blazeBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

deep linden
warped blazeBOT
teal haven
#

oh okay