Put all webhooks in choices

Hi, is it possible to fetch all guild webhooks, and put them to the choices in slash command?
4 Replies
d.js toolkit
d.js toolkit4w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Maksym_Tyvoniuk
Maksym_TyvoniukOP4w ago
I mean here
No description
lupus
lupus4w ago
Yes, you can fetch all Webhooks of a Guild using <Guild>.fetchWebhooks() (you may need to cache them) and then supply them via Autocomplete (as in Autocomplete Interactions).
d.js docs
d.js docs4w ago
:method: Guild#fetchWebhooks() [email protected] Fetches all webhooks for the guild.
// Fetch webhooks
guild.fetchWebhooks()
.then(webhooks => console.log(`Fetched ${webhooks.size} webhooks`))
.catch(console.error);
// Fetch webhooks
guild.fetchWebhooks()
.then(webhooks => console.log(`Fetched ${webhooks.size} webhooks`))
.catch(console.error);
:guide: Slash Commands: Autocomplete read more

Did you find this page helpful?