Twitch

Обычная версия

if Stream going live for X then Make a web request

{
  "embeds": [{
    "color": 6570405,
    "author":{
      "name":"{{ChannelName}}",
      "url":"{{ChannelUrl}}"
    },
    "description": "**is now streaming on Twitch**",
    "fields": [
      {
        "name": ":video_game: Game",
        "value": "{{Game}}",
        "inline": true
      },
      {
        "name": ":eye: Viewers",
        "value": "{{CurrentViewers}}",
        "inline": true
      }
    ],
    "image": {
      "url": "{{StreamPreview}}"
    },
    "footer": {
      "text": "http://twitch.tv",
      "icon_url": "https://d1qb2nb5cznatu.cloudfront.net/startups/i/114142-19c0993bf69c468f1350fd422bfad6b2-medium_jpg.jpg?buster=1410211530"
    }
  }]
}

Улучшенная версия

if Stream going live for X then Make a web request

{
	"content": ":loudspeaker: Хей @everyone! {{ChannelName}} сейчас стримит {{ChannelUrl}} ! Залетайте! :wink:",
	"embeds": [{
		"color": 6570405,
		"author": {
			"name": "{{ChannelName}}",
			"url": "{{ChannelUrl}}",
			"icon_url": "URL AVATAR"
		},
		"description": "**[{{ChannelName}}]({{ChannelUrl}})** сейчас стримит на Twitch!",
		"fields": [{
			"name": ":video_game: Game",
			"value": "{{Game}}",
			"inline": true
		}, {
			"name": ":eye: Viewers",
			"value": "{{CurrentViewers}}",
			"inline": true
		}],
		"thumbnail": {
			"url": "URL AVATAR"
		},
		"image": {
			"url": " {{StreamPreview}}"
		},
		"footer": {
			"text": "twitch.tv | {{CreatedAt}}",
			"icon_url": "https://d1qb2nb5cznatu.cloudfront.net/startups/i/114142-19c0993bf69c468f1350fd422bfad6b2-medium_jpg.jpg?buster=1410211530"
		}
	}]
}

Версия для IFTTT Platform

if Stream going live for X filter Filter code then Make a web request

Filter Code

var CreatedAt = Meta.triggerTime
var Game = Trigger.Game
var ChannelName = Trigger.ChannelName
var ChannelUrl = Trigger.ChannelUrl
var CurrentViewers = Trigger.CurrentViewers
var preview = Trigger.StreamPreview + '?v=' + Math.round(Math.random() * 1000000);
var body = { content: `:loudspeaker: Хей @everyone! ${ChannelName} сейчас стримит ${ChannelUrl} ! Залетайте! :wink:`, embeds: [{ color: 6570405, author: { name: `${ChannelName}`, url: `${ChannelUrl}`, icon_url: `URL AVATAR` }, description: `**[${ChannelName}](${ChannelUrl})** is now streaming on Twitch!`, fields: [{ name: `:video_game: Game`, value: `${Game}`, inline: true }, { name: `:eye: Viewers`, value: `${CurrentViewers}`, inline: true }], thumbnail: { url: `URL AVATAR` }, image: { url: preview }, footer: { text: "twitch.tv", icon_url: `https://d1qb2nb5cznatu.cloudfront.net/startups/i/114142-19c0993bf69c468f1350fd422bfad6b2-medium_jpg.jpg?buster=1410211530` }, timestamp: CreatedAt }] };
MakerWebhooks.makeWebRequest.setBody(JSON.stringify(body));

Last updated