Skip to main content

Twitch

Plugin name: twitch

Notice

Jan 10, 2021: This plugin is currently disabled. It will be enabled on all instances once the rewrite is complete.

The twitch plugin provides an advanced system to announce twitch streams within your guild. Two major options exist where the first is the traditional method of defining a list of streams to announce when they are live, the second method allows for dynamic stream announcements based off members of your guild who are streaming.

This includes the dynamic assignment of roles which can be used to hoist currently streaming members higher in the guild member list. Other options include custom message announcements, and basic regex for stream title and game to ensure only specified streams are announced for your guild.

info

Announcements can only occur once per hour per user into a channel. If the stream is not restarted after the hour, it will not re-announce.

Configuration Options

OptionDescriptionTypeDefault
configsA mapping of channels to channel configurations.dictNone
ignore_usersA list of ignored users for all configslist(snowflake)empty

Channel Configuration

OptionDescriptionTypeDefault
stream_roleUsers that belong to this role id will be considered as part of the stream announcement (tip use !roles to find the id to use)snowflakeNone
add_rolesList of role id's that will be added to the user when streaming. This can be used to hoist the users for example.snowflake list[]
ignore_rolesList of role id's that will be ignored, even if the user belongs to the stream_rolesnowflake list[]
ignore_usersList of user id's that will be ignored for this channel, even if the user belongs to the stream_rolesnowflake list[]
messageCustom announce message. The following tokens can be used: {user} - Streamers username, {here} - @here, {everyone} - @everyone, {r123456789012} - @role Custom role id which must follow the letter rstrNone
notification_typeEither set to the following which will announce to the specified: HERE - @here, EVERYONE - @everyone, ROLE - Specific role defined in notification_target optionEnumNone
notification_targetSnowflake role id of custom role to announce to when notification_type is set to ROLEsnowflakeNone
title_reregex to be used on the stream title. This is case insensitive.str / regexNone
game_reregex to be used on the game title. This is case insensitive.str / regexNone
streamsList of stream names to subscribe to. When the stream is live it will announce.str listNone
channel_idChannel id used if the config is set to a unicode string. This allows the same channel to have multiple configurations by having different unicode string configssnowflakeNone

Configuration Examples

Basic Stream Subscribe Example

The following example is a basic example of subscribing to a list of streams that will be announced to a channel when live.

twitch:
configs:
297917022300274688:
streams:
- warframe
- discordapp
- JakeyPrimed

Advanced Example

The following example is based off the following conditions:

  • Everyone should be announced if they meet below conditions
  • Only for the game Warframe
  • A custom message and announce to custom role
  • A specific role is excluded
  • A specific role is added when streaming
twitch:
configs:
297917022300274688:
stream_role: 146691885363232769 # everyone role
ignore_roles:
- 748393947474923485 # Naughty people
add_roles:
- 544172349474340868 # Currently Streaming
game_re: 'warframe'
message: |-
{r1234567890122334} {user} is being totally awesome and
streaming right now you should check it out!!

It should be noted that it is also possible to specify the configs as a unicode string thus allowing multiple configurations for the same channel as follows:

twitch:
configs:
devstream:
channel_id: 297917022300274688
streams:
- warframe
title_re: 'devstream'
message: |-
DevStream is now live!
ps4:
channel_id: 297917022300274688
streams:
- warframe
title_re: 'ps4 @ 4'
message: |-
PS4 @ 4 is now live!
xbox:
channel_id: 297917022300274688
streams:
- warframe
title_re: 'xbox one @ 1'
message: |-
XB1 @ 1 is now live!