#Webhooks VS Sending messages

6 messages · Page 1 of 1 (latest)

lunar garden
#

I have seen some bots use Webhooks instead of sending through the clieny for some messages. I believe Dyno sends event logs through Webhooks. I already know you can send messages through webhooks without needing to log in. Does anyone know why and any advantages of doing so?

hushed grailBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

lunar garden
#

djs version: 14.11
nodejs: 18.16 (LTS)
(I don't think versions matter for this question)

blissful flint
#

Advantages:

  • it doesn’t need the bot to be logged in so you can use it for logging purposes, even when the thing you want to log caused the bot‘s connection to close/wasn’t open in the first place
  • the webhook has its own ratelimit bucket so if you log a lot of stuff it doesn’t ratelimit your bot doing its thing at the same time
  • you can send messages under a different username and avatar
lunar garden
#

so its rate limit advantages? is webhook's limit lower than sending messages' rate limit

blissful flint
#

No*. But it doesn’t share the ratelimit with your other sending your bot does
* ratelimits are dynamic so not entirely true