Twitch Connector
The Twitch module and connector provide:
- A notification service that watches Twitch streamers go live and offline and posts to one or more of the webhooks configured in your Discord server.
Note
A separate set of lookup commands (checking a user's info, checking their current stream, posting their channel link, or posting a random streamer for a game) was retired with no replacement.
See also
A step-by-step walkthrough: Configuring a Social Connector.
Twitch Notifications
See also
The connector posts through Discord webhooks, so you need to know how they work. See this official guide for an introduction.
By default each notification is posted with the Twitch account username as author and the Twitch avatar as the Discord profile picture. You can customize these settings and others for each stream.
The Twitch profile URL goes to Discord, and the stream preview uses Discord's own parsing of Twitch content.
Note
The Twitch API has limits and inconsistencies, so a notification can arrive late or be missed, and duplicates happen occasionally. The module runs extra checks to reduce duplicate notifications.
Managing Twitch notifications
You add, edit, remove and list Twitch notification services from your server's Twitch page on this dashboard; there is no Discord command for it any more.
When you add a notification service you pick the Twitch account and the channel to post to, and the dashboard creates the Discord webhook for you (this needs GiselleBot to have "Manage Webhooks" permission in that channel). The customization options below are fields on the service's form.
Customization options
Game filtering
Adds a whitelist (inclusive) filter for game names. A notification is only sent when the streamed game matches one of the filtered games; streams of other games are skipped.
Enter a comma-separated list on the Twitch page's Game Filter field - a multi-word game name like league of legends is just its own comma-separated entry, no quoting needed. All filters are case-insensitive, but the game name has to match exactly for the filter to work.
Warning
This only works for the game set at the start of a stream. Changing the game mid-stream does not trigger another "Live" notification.
Default: No filter
Event type filtering
Adds a whitelist (inclusive) filter for events. A notification is only sent when its event matches one of the filtered events.
This feed supports only two events:
live, sent when a Twitch user starts streaming a game;offline, sent when a Twitch user ends their stream.
Default: No filter
Custom header message
Sets the message template used when notifications are posted. Custom headers take at most 1024 characters.
Custom headers are plain text. For a formatted card, fill in the Embed Header fields on the feed's page instead: title, description, colour, image, thumbnail, footer and author. When any of them is set, the item is posted as an embed instead of plain text.
Placeholders (such as %title% or %author%) work in every embed field, and a title containing quotes or special characters is posted exactly as written. The old "embed JSON" syntax that broke on special characters is no longer needed or documented. If a feed still carries an old JSON header, its page shows the saved value with a note and the embed fields to replace it.
Custom headers support these dynamic tags, replaced at run time:
- %display_name%: the account's display name, with its letter cases (e.g.
Cycloptux) - %username%: the "URL" username of a Twitch user, typically lowercase (e.g.
cycloptux) - %game%: the name of the streamed game (e.g.
Fortnite) - %status%: the description usually added below the game title during a stream.
- %stream_status%: one of two values,
Livefor a going live notification,Offlinefor a stream end. - %timestamp% or %timestamp_utc%: the UTC time when the event started, with format
YYYY-MM-DD HH:mm:ss (UTC). - %timestamp_iso%: the UTC time when the event started, as an ISO8601 string.
- %timestamp_pst%: the PST time when the event started, with format
YYYY-MM-DD HH:mm:ss (PST). - %url%: the Twitch profile URL. See below for more info.
Timestamp tags accept a custom time zone. Replace the utc part with either:
A different valid IANA time zone identifier (e.g. America/New_York, Europe/London).
An UTC offset in the form
[UTC/GMT](+/-)(hours)[:][minutes], for example:- %timestamp_Europe/London%
- %timestamp_America/Los_Angeles%
- %timestamp_Japan%
- %timestamp_PST8PDT%
- %timestamp_+0800%
- %timestamp_-10:30%
- %timestamp_UTC+2%
Without %url%, the Twitch profile URL is appended after every header on a new line, and Discord renders it.
If the %url% parameter is used, the default URL will not be appended to the custom header.
The default header differs for online and offline messages. A custom header is used for both, so use the %stream_status% tag to tell them apart.
Default: :red_circle: Now Live on Twitch: %display_name% | :video_game: Playing %game%. and Stream Offline: %display_name% | :video_game: Playing %game%.
Custom webhook name
Sets a custom username on the webhook when notifications are sent. Custom usernames take at most 32 characters.
Default: New notifications are sent by a webhook named after the Twitch account's display name
Keep the webhook's default username
Removes any custom name from the webhook. The real webhook name (the one you assigned when creating the webhook in Discord) will be used.
Default: false (Custom or automated names will be applied)
Keep the webhook's default avatar
Removes any custom avatar from the webhook. The real webhook avatar (the one you assigned when creating the webhook in Discord) will be used.
Default: false (Automated avatars will be applied)
Permissions needed on the dashboard: Manage Webhooks (server-side)
Editing a notification service
Editing a service on the Twitch page replaces all of its customization options with what you set in the edit form. It is not a partial update, so check its current settings before you change them.
Removing a notification service
Removing a service on the Twitch page stops it and removes its link to the server webhook.
Listing notification services
The Twitch page lists every notification service currently linked to a webhook in the server.