(Solved) Access channel webhooks from interaction?
I'm creating a slash command with discord.js and I need to be able to fetch/create webhooks.
I already tried
CommandInteraction.channel.webhooks
but nothing shows up when I type it in15 Replies
TextChannel#fetchWebhooks()
Fetches all webhooks for the TextChannel#createWebhook()
Creates a webhook for the channel.
check for the type of the channel first?
btw u dont need to import client
u can access via <Interaction>.client
oh thanks
What's the problem here?
I'm creating a slash command with discord.js and I need to be able to fetch/create webhooks.
I already tried
CommandInteraction.channel.webhooks
but nothing shows up when I type it in
yeah i didSo you need to fetch webhooks
and interaction.channel doesnt have fetchWebhooks or createWebhook
It does if you check that it's a
GUILD_TEXT
channel
You need to know how to typeguard if you're going to use TypeScriptits GuildTextBasedChannel
I think isText() in 13.8 includes channels that can't have webhooks
Like DMChannel, Thread channel
oh i see
it shows up now thanks