#fetchWebhook and WebhookClient

6 messages · Page 1 of 1 (latest)

shadow linden
#

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 ?

valid cargoBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
leaden tide
#

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