#Webhook ForumChannel doesnt work as planned

7 messages · Page 1 of 1 (latest)

mossy pastureBOT
#

• 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.

restive anvil
#

const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('create-impostor-thread')
.setDescription('Impostor thread!!')
.addUserOption(option => option.setName('user')
.setDescription("This user will be impersonated"))
.addChannelOption(option =>
option.setName('channel')
.setDescription('The channel to post')
),
async execute(interaction) {

    const { options } = interaction
    const member = options.getUser('user');
    const channel = options.getChannel('channel');

    await channel.createWebhook({
        name: member.username,
        avatar: member.displayAvatarURL({dynamic: true})
    }).then((webhook) =>{
        webhook.channel.threads.create({
                name: "Hahaha",
                autoArchiveDuration: 10080,
                message: {
                    content: "It's me Mariooo",
                },
                reason: 'Backup',
            }
        )
        setTimeout(()=>{
            webhook.delete()
        },3000)
    })

    await interaction.reply("Done!")
}

};

#

Webhook ForumChannel doesnt work as planned

sturdy sparrow
restive anvil
sturdy sparrow
#

Or the execute Paramus