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 toolkit7mo 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
Kinect30007mo 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
Naydrac7mo ago
Ok thank you very much !