Webhooks
I want to ask what are webhooks...? what is their purpose with djs and outside...? what can webhooks do and their limitations...? can discord webhooks only send messages...? Is there a way i can use webhooks to connect to some other website/app...like making my own app and getting discord messages on my app than on this interface or it is seemingly not possible at all... how is it done then? Tell me like i know nothing about them...
29 Replies
- 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!Further note: i have already read the djs site...developer portal... multiple blogs... asked chatgpt about it... asked some people about it...
Frankly speaking i never worked with webhooks... they were at last of the topic so before trying them out...i wanna know their philosophy
the guide tells you what a webhook is
webhooks only send messages, they dont receive any data from discord as they arent a client that connects to the gateway
If they dont recieve data then why post and get webhooks... what is the use of get webhooks with respect to djs... i have seen bot sending
other channel news
and i know they re webhooks...but arent they just post webhooks... why use get... also kindly refer to all of my questions... i am kinda confused as why one need to use them when they are alr using djs for bot makingbecause you dont connect to the gateway when using a webhook
literally read the image I sent
I have read 3 times the djs guide man... i am unable to grasp the concept
I dont know what type of answer you expect. With webhooks you dont need to log in with your bot at all to send messages
Kindly answer my questions as i have written in order... they may help me out... i dont see the appeal of why does one uses webhook in replacement of bot except they re not using the bot... also im confused as wdym by log in with bot...
Sending message without the bot and sending them without being logged into bots are 2 things...right
In 1st i am assuming discord has a system which sends the message as soon as it receives their id and message content-> in case it is a post webhook...just like how URLs turn into embeds...
In 2nd i am assuming bot is someone else's and once they receieve a webhook...the bot sends it...so u dont have to be logged in them to work...
Kindly tell me if i am correct on anything
webhooks just send messages. they dont need t o login, no ws connection, no nothing. they can be used in for example websites. webhooks are also somewhat separate from bots, they can be created by anyone. Look at bots such as pluralkit, they use webhooks
all it takes is a simple post request
Thank you now it is being understandable... why do we have 3 GET webhooks and what is their purpose since post will upload something on a channel
you can also get messages sent by the webhook
To do what?
whatever you want to do with it
Kindly tell me an example... is it like to take a message from one channel using get webhook and then post in other channel using post webhook?
webhooks can only fetch their own messages
So a message they have posted... they can fetch them again for a reuse?
https://old.discordjs.dev/#/docs/discord.js/14.13.0/class/Webhook?scrollTo=fetchMessage all methods for a webhook can be found here
Thank you i will look into it too...but lets continue with the explanation
If i can do that.... it also means i can reuse multiple webhooks to send in as many channels i like?
a webhook is per channel
Can I use discord webhooks out of discord...like either sending to my own webapp or saving it in file
no, webhooks only send messages to a discord channel
Ok last question
If i want to use the feature to post the embed to channels and on my webapp both... should i use bot to do that or is there any other way to achieve that...
I had seen a server where they used to send embeds on channels and on their website...idk if they did it automatically or manually
they probably use a webhook
So i can use webhooks out of discord to post messages to my website as well...
to post messages from
not to
you dont send any messages to your website, you send a message with a webhook from your website code to the discord channel
Oh i see... now i understand.. so summary of this conversation is that webhooks can only send messages to discord channels out of anywhere...without using the bot...by anyone..
But in order to fetch commands or embeds from channels to post outside...i must use bot and hence the api!
Thank you very much gentleman and gentle lady for the help