Closed zeteticl closed 2 years ago
According to the discord.js documentation, there is no fetchWebhooks
method on ThreadChannels.
Im not sure if there is a reason for it not existing, you can try asking the discord.js developers.
In the meanwhile you can try using guild.fetchWebhooks()
and see if you find the webhooks you're looking for in there.
Thankyou so much. Finally i done my work
const channel = await client.channels.fetch(discord.channelId);
let webhooks = await channel.fetchWebhooks();
webhook = webhooks.find(v => {
return v.name == 'XOXO' && v.type == "Incoming";
})
await webhook.send({ content: text, username: message.myName.username, avatarURL: message.myName.avatarURL });
It is work in channel, but get error in thread
error TypeError: channel.fetchWebhooks is not a function