Skip to content

Instantly share code, notes, and snippets.

@DerEnderKeks
Last active December 4, 2023 20:28
Show Gist options
  • Save DerEnderKeks/6448c28f5e32b4b52741fbda4ec34285 to your computer and use it in GitHub Desktop.
Save DerEnderKeks/6448c28f5e32b4b52741fbda4ec34285 to your computer and use it in GitHub Desktop.
Simple Webhook Tutorial (Twitter -> Discord using IFTTT)

Simple Webhook Tutorial

In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel.

Step 1 - Register on IFTTT

  1. Go to https://ifttt.com/ and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send Tweets.

  2. In the settings for that channel, find the Webhooks option and create a new webhook.

Note: Do NOT give this URL out to the public. Anyone can post messages to this channel using it, without even needing to be in the server. Keep it safe!

  1. You can name the webhook whatever you want, and give it any image; for this tutorial we override them later anyway. Keep track of the URL; we'll need it later.

Step 3 - Make an IF recipe

  1. Click on you profile icon in the top right corner
  2. Click on Create
  3. Click on This
  4. Search for Twitter
  5. Click on the Twitter square
  6. Select a trigger like New tweet by you or New tweet by a specific user
  7. Set the options for the selected trigger (depending on which you selected)
  8. Click on That
  9. Search for Webhook
  10. Select the Webhook square
  11. Select the Make a web request action

Step 4 - Setup the webhook

  1. Paste your webhook URL in the URL box.
  2. Select Post in method, and application/json in content type.
  3. Paste the following snippet into the Body field and modify it to your liking. You should at least set the icon_url. (You can add other details like the post time, click the Add ingredient button to see what is available)
{
  "username":"@{{UserName}}",
  "icon_url":"<url to image>",
  "content":"{{LinkToTweet}}"
}

Step 5 - Profit

Now what you have to do is just click Create Action. It will start to run immediately.

@iSyad
Copy link

iSyad commented Sep 27, 2021

Can anyone help me with my problem. Why does my LinkToTweet doesnt work as it should.. I mean like it before this it works fine but after a few days my discord bot sent the tweet but without the link.

image_2021-09-27_093746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment