fetchWebhook and WebhookClient

Hi, As far as I know, instantiating a WebhookClient create a new Rest instance which is not a good thing if we already have a client, so we need to use client.fetchWebhook(). But I just need to send a message with a webhook, and fetchWebhook() make an API call, which is uncessary in that case because I don't want to fetch it, I only need webhook.send(). I already have its ID and token. What can I do ? Do I need to use client.rest.post directly ?
3 Replies
d.js toolkit
d.js toolkit13mo 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 staff
Kinect3000
Kinect300013mo ago
You could make the Webhook class instead new Webhook(client, { id, token }) I’m pretty sure webhooks have their own rate limits anyways Unless it’s memory that ur concerned abt
Naydrac
NaydracOP13mo ago
Ok thank you very much !
Want results from more Discord servers?
Add your server