In this repository, you will see how to make a basic webhook. A webhook in web development is a method of augmenting or altering the behavior of a web page or web application with custom callbacks. These callbacks may be maintained, modified, and managed by third-party users and developers who may not necessarily be affiliated with the originating website or application. Wikipedia.
When a Discord User votes your bot/server on Top.gg, it sends a HTTP response to the given webhook address. We are not able to use Discord's Channel Webhooks, as they do not accept HTTP reponses. But we have made a solution, this snippet will parse the HTTP response and will send the response to a discord channel via Discord Webhook.
- Have a 24/7 Host. e.g. Alaister.net
- Node.JS Engine Download
- Git Software Download Link
- Knowledge of Ports
- Basic Knowlegde of Webhooks
- Basic Knowledge of Node.js and Node Package Manager(npm)
You can get code by any of the one method listed below:
By Git
git clone https://github.com/Elitex07/dblwebhook Folder_Name
By SSH
[email protected]:Elitex07/dblwebhook.git
By Github CLI
gh repo clone Elitex07/dblwebhook
Some entries to be filled in index.js:
- Webhook-Auth on Line 6: Authorization Text in Webhook section on Top.gg (Decided by User on Top.gg)
-
Discord Webook URl on Line 12: Add a Discord Webhook URL - to create one, to Channel Settings -- Integration -- Create Webhook
-
Port on line 22: Enter the port of your console of the Host. If hosted by sources like VPS or Windows Terminal: Enter a Random Number [remmeber this number, we would require in furthur steps]
- Save the File
- Open Terminal or something where you can type in commands.
- Install required packages by
npm install
- Run the Main File by
node index.js
- Get the console URL and port
- Head to Webhook section in Top.gg
- Paste the console link
- Add Port and /vote to the end. i.e. if my console url is
sftp://abc.net
then make itsftp://abc.net:port/vote
- Save the Stuff and Run a Test
Join one of these Discord Servers, to get support: