Skip to content

Instantly share code, notes, and snippets.

@alexanderklatt
Last active December 13, 2022 18:21
Show Gist options
  • Save alexanderklatt/5053abefe5447fe8dc3f5f9b6e6b9aa0 to your computer and use it in GitHub Desktop.
Save alexanderklatt/5053abefe5447fe8dc3f5f9b6e6b9aa0 to your computer and use it in GitHub Desktop.
IFTTT Post Request JSON Body - Embedded Discord Message When Stream Goes Live
{
"embeds":[
{
"title":"<<< {{ChannelName}} is live on Twitch!>>>",
"url":"<<<{{ChannelUrl}}>>>",
"description":"<<<{{Game}}>>>"
}
]
}
@alexanderklatt
Copy link
Author

Paste this code into the body field of a web request going to your discord endpoint.
This code is meant to be used at ifttt.com.

@Braun90
Copy link

Braun90 commented Sep 30, 2020

Would I be able to add a stream preview to this? I use it now but it kind of looks scammy.
Screenshot_20200929-152626

@alexanderklatt
Copy link
Author

Many people asking about the stream preview functionality (both here and on YouTube). I've made comments on YT to this end, but basically when I originally built my applets - the stream preview ingredient that IFTTT was sourcing from twitch was not stable. The ingredient URL linked to a generated thumbnail for your stream that was hosted someplace online (which is exactly what I expected) - the only problem was that the image at the URL would only sometimes be an actual thumbnail of the stream. I'd say 80% of the time it was a sample image with dimensions inside of it. I do not know if that problem lies within twitch, ifttt, or something about my stream itself, but the preview ingredient was unstable back when I tried using it. I'll give things another go now and report back since it has been awhile since I've tried and its clear a lot of people are seeing my video.

Just wanted to put my experience here in case others are struggling to implement it as well.

@bavario-lginc
Copy link

Hi, that's a cool JSON message! Would I be able to ping a role like this too?

@alexanderklatt
Copy link
Author

I do not know of a way to ping a role with an embedded request like this. Let me know if you figure it out!

@damnshortaay
Copy link

Hi, that's a cool JSON message! Would I be able to ping a role like this too?

I was able to ping a role by adding the following

{
"content": "<@&ROLEID>",
"embeds":[
{
"title":"<<< {{ChannelName}} is live on Twitch!>>>",
"url":"<<<{{ChannelUrl}}>>>",
"description":"<<<{{Game}}>>>"
}
]
}

@bavario-lginc
Copy link

Thank you! That worked!

@alexanderklatt
Copy link
Author

Hi, that's a cool JSON message! Would I be able to ping a role like this too?

I was able to ping a role by adding the following

{
"content": "<@&ROLEID>",
"embeds":[
{
"title":"<<< {{ChannelName}} is live on Twitch!>>>",
"url":"<<<{{ChannelUrl}}>>>",
"description":"<<<{{Game}}>>>"
}
]
}

Nice! Thanks for posting.

@ST0D0
Copy link

ST0D0 commented Apr 29, 2021

wait so how could i @everyone cuz i'm having trouble to figure this stuff out

@atomracer
Copy link

wait so how could i @everyone cuz i'm having trouble to figure this stuff out

{
"content": "<@everyone>",
"embeds":[
{
"title":"<<< {{ChannelName}} is live on Twitch!>>>",
"url":"<<<{{ChannelUrl}}>>>",
"description":"<<<{{Game}}>>>"
}
]
}

@muditdua
Copy link

Hi, that's a cool JSON message! Would I be able to ping a role like this too?

I was able to ping a role by adding the following
{
"content": "<@&ROLEID>",
"embeds":[
{
"title":"<<< {{ChannelName}} is live on Twitch!>>>",
"url":"<<<{{ChannelUrl}}>>>",
"description":"<<<{{Game}}>>>"
}
]
}

Nice! Thanks for posting.

hey this is now giving error:( when i m posting this on ifttt it shows error in "url" , "Channel name " " channel url" :(( plsss fix this if u can plssssssssssssss:((((

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