• Hey! Register here to create your account, engage with the community, and talk about what is new!

[ Discord Webhooks ] & [ Web Requests ]

KyllianGamer

New member
Joined
Oct 31, 2020
Messages
10
Reaction score
7
Hello, I will be explaining how to use Discord Webhooks & Web Requests!
Before I get started I want to clear some things out:
- For more advanced applications we will be using real code (JavaScript).
- I am not a professional so if I make any mistakes please let me know so I can learn from them and correct the post.
- It is NOT possible to receive response data, while alot of people think it is possible, but more on that later!
- Overlord is required. I am currently not an Overlord, I will be using the plot of EpicFireyCreeper, so thanks to him!
- You can also use Web Requests to send more advanced messages to a Discord Webhook.

Discord Webhooks
What is a Webhook?

A Discord Webhooks is a Unique URL that you can use to link services together. They allow you to automate messages and send data to Discord Text Channels.
1604487372228.png
To use this feature we will need to setup a Webhook first. How?
1. Go to the server that you will create a webhook in.
2. Go to the server settings and click "Integrations".
3. Now press "Webhooks" and add a new webhook. You can name it whatever you want, make sure to set the channel to the channel where you want webhooks messages to be received.
4. Done! Make sure to copy the Webhook URL (gray button) since we will be needing this to send messages.

Want a video on how to setup Discord Webhooks?

Now let's send a simple message to the Webhook!
Place down a Game Action block in your codespace, navigate to "Web Manipulation" and select "Send Discord Webhook Message"! We will need to put 2 values in the chest:
1. The URL, this is the URL you had to copy from the Webhook you made earlier. (Use a text book and type the URL in chat while holding it)
2. The message, very simple, you just insert whatever message you want to send to the Webhook.

Quick Example:
I made this simple example that sends the message "(Player Name) joined your plot!"
And when a player leaves it says "(Player Name) left your plot! :("

Web Requests
What are Web Requests?
A web request is a communicative message that is transmitted between the client, or web browsers, to the servers. ... The client or web browser will then connect to the server that it's seeking information and data from. This can also be used with Discord Webhooks to send advanced messages such as embeds, files, etc.

1604497010977.png
Place down a Game Action block in your codespace, navigate to "Web Manipulation" and select "Send Web Request "! We will need to put 2 values in the chest:
1. The URL the webrequest needs to be made to.
2. The date that will be send to the URL.
There is also 2 parameters in the chest:
- Request Type (a GET type does NOT mean you can receive data!!!)
- Data Type (Whether you will be giving JSON data or plain text)

There's an endless amount of things you can do with this, I will be giving 2 examples.
The first one being the more advanced way of Discord Webhooks and the 2nd example will be with actual code.

Application 1 (No Real Code required!)
In this first application we will be creating more advanced Discord Messages using the Web requests.

First of all I created an Embed using a site called discohook.org, this is an embed builder that turns the embed into JSON that we then can use to send with Web Requests. When the embed was done I copied the JSON value and inserted them the same way I did with Discord Webhook block but this time with a Web Request block, do not forget to set the 2nd tag to "JSON". If you don't understand the text explanation then go ahead and watch the video or comment below with your question!


Application 2
Not finished yet, W.I.P. :P
 
Last edited:

RolandMC123

Forum adept
Joined
Sep 9, 2020
Messages
186
Reaction score
50
Nice! Although it doesn't explain all of the principles behind the different types of requests & such, this is a great guide for beginners that just want to send some data over to discord.
 

KyllianGamer

New member
Joined
Oct 31, 2020
Messages
10
Reaction score
7
Nice! Although it doesn't explain all of the principles behind the different types of requests & such, this is a great guide for beginners that just want to send some data over to discord.
Thanks <3
 

PettatoGaming

Active member
Overlord
Joined
Sep 6, 2020
Messages
45
Reaction score
12
this is actually quite useful thanks for posting this. i never got to play around with webhooks fully yet but will do in future
 

Vulcano

Forum adept
Overlord
Joined
Sep 11, 2020
Messages
243
Reaction score
63
It would've been much easier to learn if I had this tutorial while learning!
 

stinkey

Forum adept
Joined
Sep 8, 2020
Messages
225
Reaction score
74
I will be using the plot of EpicFireyCreeper, so thanks to him!
- You can also use Web Requests to send more advanced messages to a Discord Webhook.

smh you used black text rather than remove formatting RIP dark mode users,
 

smikkiekind

New member
Joined
Nov 7, 2023
Messages
1
Reaction score
0
Hey, could you please unprivate the webhook thing? I would want to know more!
 
Top Bottom