What is a Webhook? How to enable Webhooks in Discord?

by 邦卡
What is a Webhook? How to enable Webhooks in Discord?

According to the definition on Wikipedia, it is “a method of augmenting or altering the behavior of a web page or web application with custom callback functions. These callbacks may be stored, modified, and managed by third-party users and developers who may be associated with the original website or application”.

If the above paragraph is difficult to understand, don’t worry. I will explain it in plain language and also guide you on how to enable Webhooks in Discord.

What is a Webhook?

A Webhook is a connection between two endpoints triggered by “event-driven” actions. One endpoint is the “origin” and the other is the “destination.” These endpoints can be servers of various applications on the internet. When a specific event occurs at the origin, the destination receives a notification and performs a certain action.

Diagram illustrating the operation of a Webhook

Diagram illustrating the operation of a Webhook

Example of Webhook in daily life

You might have visited a food court in a department store where most seating areas are open. After placing an order, the vendor gives you a small device that makes a sound and vibrates when your meal is ready. Regardless of where you are in the food court, even if you can’t see the vendor, you immediately know it’s time to pick up your order.

In this example, the device that emits sound and vibration is similar to a “Webhook.” The triggering event is “when the meal is ready.” The vendor preparing the meal is the “origin,” and they activate the device to notify the customer at the “destination.” The action taken by the customer at that time is to pick up the meal.

Using Webhooks in Discord

Now that you understand the basic principles of Webhooks, let’s explain how Webhooks are used in Discord servers.

The most common and widespread use is as a tool for subscribing to messages. You can subscribe to messages from various community platforms or websites such as Twitter, Twitch, or Reddit. When a specific account you are following performs a specific action, such as publishing a new post, you can configure a Webhook to synchronize and publish the latest post in a designated Discord channel. This allows for real-time message notifications and even aggregation of notifications from multiple platforms and accounts into one channel, automating the message delivery function.

Commonly used Webhook integration services

Here are two well-known Webhook integration services:

  • IFTTT: It stands for “if this then that” and can connect different web applications, including Discord.
  • Zapier: It is a web service that allows you to connect different web applications, including Discord.

Publishing embedded messages through Webhooks

Have you seen messages in Discord servers that include images, titles, separate displayable content, and even hyperlinked URLs? These messages are called embedded messages.

Tools like Discohook allow you to publish or edit custom embedded messages.

Further reading: Introduction to Discohook – A Discord Embedded Message Editing Tool

Achieving Webhook effects using Discord bots

Using Webhooks sometimes involves writing programming syntax or exchanging data formats such as XML or JSON, which can be a bit more complex. An alternative is to look for Discord bots that provide similar functionalities. For example, there are ready-to-use bots for integrating with social media messages:

How to Enable Webhooks in Discord

First, open the “Server Settings” menu, then navigate to “Integrations” under the “APPS” category, and click on “View Webhook” on the right side of the Webhook.

View Webhooks

View Webhooks

Next, you can open the Webhook settings and click on “New Webhook” to create one. Each Webhook has five options for operation.

  1. Avatar: This can change the avatar displayed when the Webhook publishes messages in a channel.
  2. Name: This can change the name displayed when the Webhook publishes messages in a channel.
  3. Channel: Determines which channel will execute the received information.
  4. Copy Webhook URL: This is the most important content of the entire Webhook and is crucial for its operation. Remember not to leak the running Webhook URL, as someone with malicious intent could use this URL to send malicious messages to your Discord channel.
  5. Delete Webhook: Deletes the created Webhook.

Webhook Configuration

Webhook Configuration

Once you have the Webhook URL, you can use it in Webhook integration services to make it effective or write your own code to utilize it.

You may also like

Leave a Comment