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.

@Krojack
Copy link

Krojack commented Sep 13, 2021

Is it possible to use the "New tweet by a specific user" and also include "with a hashtag"? I want to watch tweets from a user that also include a hashtag. I don't want all tweets from that user.

Even better would be if I could regex match text in the tweet message, or both hashtag and tweet message matching to narrow down.

@MULTidll
Copy link

MULTidll commented Sep 25, 2021

Screenshot 2021-09-25 112540

Can anyone help me with this i used this body { "username":"MULTi", "avatar_url":"AVATAR-LINK", "content":"@{{UserName}} tweeted this at {{CreatedAt}}: {{LinkToTweet}}" }
but yestarday 24/9/2021 it was working

@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