#Webhook ForumChannel doesnt work as planned
7 messages · Page 1 of 1 (latest)
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
You are using member which is referring to the member given in the options of the interaction use client.user instead
Doesnt seems to be a problem, but i changed it and it still doesnt change result. Any other ideas?
I thought that creating thread is in other scope than forumchannel and that might be a problem
Hmm maybe where u execute the command you didn’t give client to the options
Or the execute Paramus