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.

@Nonameboiiscool
Copy link

Hey I also wanted to ping a role while sending it so should I put the <@&roleid> in the last ??

Before the last } ?

@boumer7
Copy link

boumer7 commented May 5, 2021

I get "Application Failure: Too many requests to this host"

Me also

@Gullivr1
Copy link

Gullivr1 commented Jun 7, 2021

How do i add the Text ingredient to this:
{
"username":"@{{UserName}}",
"icon_url":"",
"content":"{{LinkToTweet}}"
}

@pekatour
Copy link

pekatour commented Jun 9, 2021

How do i add the Text ingredient to this:
{
"username":"@{{UserName}}",
"icon_url":"",
"content":"{{LinkToTweet}}"
}

Try something like this :
{
"username":"<<<<>>>>", [don't copy this, just put your a name between the brackets or leave the one from your example]
"avatar_url":"<<<https://awebsite.hoster.picturenamejpg>>>",
"content":"{{Text}}"
}

@Maverrin
Copy link

Hello

I am doing something very simple :

{
 "content": " **New tweet** : {{LinkToTweet}}"
}

However, when there is a integrated link in the tweet, it isn't shown in my discord server. Do you know how to keep integrated link in my discord server?

@iKxzumas
Copy link

How i can add a mention role for ping people?

@mattizhu
Copy link

mattizhu commented Jul 6, 2021

Just to elucidate this issue, IFTTT is having problems regarding rate limiting that Discord has imposed but working with them to find solutions.

https://help.ifttt.com/hc/en-us/articles/1260804901449-Webhooks-to-Discord-may-fail-due-to-rate-limiting-too-many-requests-to-this-host-error-

@Azarora
Copy link

Azarora commented Jul 9, 2021

I want to @everyone in my discord when there is a new tweet in my discord, what should my body in the IFTTT applet look like in this case?

@Cactirocket
Copy link

I did everything right, it isn't working.

@HelloMukama
Copy link

Thanks this worked!

@Ru-Pirie
Copy link

I want to @everyone in my discord when there is a new tweet in my discord, what should my body in the IFTTT applet look like in this case?

when you have the "content" tag add @everyone {{LinkToTweet}} and that should work.

@ShuraKronos
Copy link

Hello, i tried this and got stuck at step 4. I copy the webhook URL from discord, but there is no URL box in IFTTT. There is only a buton that says Connect, and when clicked a mini brower window pops up asking for authorization, and once given, it goes to an error 404.
Screen Shot 2021-08-26 at 9 35 23 PM
Uploading Screen Shot 2021-08-27 at 6.35.10 AM.png…

@Ventil4tor
Copy link

If it doesn't work, check this:

https://ifttt.com/twitter/settings

my Webhook didn't work since months and this was the problem, my account was offline.
click on reconnect and after some minutes it works.

@ShuraKronos
Copy link

Thanks for the reply. It seems my mac was giving the issue. I tried doing the same process on a PC and it worked.

@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