Twitch
Plugin name: twitch
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.
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
Option | Description | Type | Default |
---|---|---|---|
configs | A mapping of channels to channel configurations. | dict | None |
ignore_users | A list of ignored users for all configs | list(snowflake) | empty |
Channel Configuration
Option | Description | Type | Default |
---|---|---|---|
stream_role | Users that belong to this role id will be considered as part of the stream announcement (tip use !roles to find the id to use) | snowflake | None |
add_roles | List 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_roles | List of role id's that will be ignored, even if the user belongs to the stream_role | snowflake list | [] |
ignore_users | List of user id's that will be ignored for this channel, even if the user belongs to the stream_role | snowflake list | [] |
message | Custom 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 r | str | None |
notification_type | Either set to the following which will announce to the specified: HERE - @here, EVERYONE - @everyone, ROLE - Specific role defined in notification_target option | Enum | None |
notification_target | Snowflake role id of custom role to announce to when notification_type is set to ROLE | snowflake | None |
title_re | regex to be used on the stream title. This is case insensitive. | str / regex | None |
game_re | regex to be used on the game title. This is case insensitive. | str / regex | None |
streams | List of stream names to subscribe to. When the stream is live it will announce. | str list | None |
channel_id | Channel 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 configs | snowflake | None |
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!