Our community has expressed an interest in being able to raid other streamers on the platform live as they are completing their own stream. This is beneficial to the platform as a whole as it helps our streamers cross-promote each other and increase the visibility of the diversity of content on Glimesh.
Raiding differs from Hosting in that hosting is typically an automatic process that streamers set up ahead of time and it happens while they are offline. Raiding is a spur-of-the-moment action that streamers may wish to take while they are live and about to end their stream.
Feature Details
Streamers must meet the following qualifications to raid other streamers:
Their account must be more then 5 days old
They must have a verified email address
They must not be banned from the target streamer’s chat
Streamers must allow raiding to be raided by other streamers (default is off).
Streamers may block other channels from raiding them (separate from the chat bans).
Streamers may restrict incoming raids to only channels they follow.
Streamers have the option to customize the incoming “raid message” so if they are uncomfortable with the term “raiding” or otherwise wish to personalize the message for their community. The message optionally can contain placeholders that the system will replace at runtime – “{streamer}” will be replaced with the name of the raiding streamer and “{count}” will be replaced with the number of users participating in the incoming raid.
Settings page
Workflow
A streamer initiates a raid via the following steps:
1) Finding someone to raid
A streamer can open the Glimesh website and navigate to one of our category pages. At the top of the page there will be a filter button called “Can raid?” they can toggle on and the page will show them only the streams that are available for them to raid. This filter is based on the logged-in streamer so it will not show streams that have blocked that streamer from raiding them via the settings above.
2) Commencing a raid
After filtering the channels down to raid-able ones, the streamer can then click on the stream in the category list and go to that streamer’s stream page. At the top of the stream page, there will be a “Raid” button next to the “Support” button. This button will ONLY appear to streamers that are currently live and able to raid the channel. The button does not appear on the raiding streamer’s own channel (ie. they cannot raid themselves).
3) The raid countdown begins
Upon clicking the “Raid” button, the streamer will be prompted to make sure they want to raid the channel and that raiding will stop their stream after a set timer. If the streamer clicks “OK”, the raid button will change to a “Cancel Raid” button with a 30 second timer. The streamer may cancel the raid before that timer completes.
When the raid timer begins, viewers on the raiding streamer’s channel will receive a toast notification at the top of the chat area about the impending raid and they are presented with a “Yes/No” option to participate in the raid. By default “Yes” will be selected for the viewers if they do not respond to the toast.
If the streamer cancels the raid, the viewers will all receive this message:
4) The raid countdown completes
Once the 30 second countdown completes, a scheduled job in the backend will pull all the viewers that had said yes to participating in the raid to the target raid channel. I then call “stop_stream()” on the raiding streamer’s channel which should take them offline (I don’t know if OBS will attempt to reconnect, so we should advise streamers to stop their streams when the raid goes through). The target raid channel will then have their customized “raid event” message posted to the chat.
The raid events are flagged as events in the chat api via a new boolean column “is_raid_message”, so third party bots should be able to detect the event once they are updated to look for it.
Statistics
I’ve added Raid statistics to the statistics page under settings. I track the number of raids for a stream and the total number of viewers that came from those raids for that stream. I’ve also updated the statistics page to only load 30 rows at a time and to use infinite scroll to load additional pages of rows. This should hopefully make the page load faster.
Limitations
Currently non-logged in users cannot participate in raids.
There is currently no mobile app integration with raids, so mobile viewers are unable to participate in raids. Will require additional API endpoints to handle all the aspects of raiding (even from a viewer perspective).
Technical Details
Added "allow_raiding" and "only_followed_can_raid" booleans (default false) to the channels table. In addition, added "raid_message" with default "{streamer} is raiding you with {count} viewers!" to the channels table.
Added a new on-the-fly scheduled job called “raid_resolver”. This is triggered dynamically when a streamer requests a raid and is scheduled for 30 seconds into the future with a max_attempts of 1.
Added a new boolean column to the “chat_messages” table called “is_raid_message” to distinguish between raid events and other events/messages.
Added a “RaidToast” javascript hook that uses bootstrap’s toast functionality to display a message above the chat panel.
Added a “RaidTimer” javascript hook to provide a visual countdown timer when a raid is started.
Added “count_raids” and “count_raid_viewers” columns to the “streams” table so we can track that information for the statistics page.
Description
Our community has expressed an interest in being able to raid other streamers on the platform live as they are completing their own stream. This is beneficial to the platform as a whole as it helps our streamers cross-promote each other and increase the visibility of the diversity of content on Glimesh.
Raiding differs from Hosting in that hosting is typically an automatic process that streamers set up ahead of time and it happens while they are offline. Raiding is a spur-of-the-moment action that streamers may wish to take while they are live and about to end their stream.
Feature Details
Streamers must meet the following qualifications to raid other streamers:
Settings page
Workflow
A streamer initiates a raid via the following steps:
1) Finding someone to raid A streamer can open the Glimesh website and navigate to one of our category pages. At the top of the page there will be a filter button called “Can raid?” they can toggle on and the page will show them only the streams that are available for them to raid. This filter is based on the logged-in streamer so it will not show streams that have blocked that streamer from raiding them via the settings above.![filters](https://user-images.githubusercontent.com/5142625/221441125-696dca3a-2ec8-4b7d-b99f-650d969fbd90.png)
2) Commencing a raid After filtering the channels down to raid-able ones, the streamer can then click on the stream in the category list and go to that streamer’s stream page. At the top of the stream page, there will be a “Raid” button next to the “Support” button. This button will ONLY appear to streamers that are currently live and able to raid the channel. The button does not appear on the raiding streamer’s own channel (ie. they cannot raid themselves).![raid-button](https://user-images.githubusercontent.com/5142625/221441167-63a27647-9f0a-4840-aee5-a1c5f2b3f35e.png)
3) The raid countdown begins Upon clicking the “Raid” button, the streamer will be prompted to make sure they want to raid the channel and that raiding will stop their stream after a set timer. If the streamer clicks “OK”, the raid button will change to a “Cancel Raid” button with a 30 second timer. The streamer may cancel the raid before that timer completes.![raid-prompt](https://user-images.githubusercontent.com/5142625/221441234-3507a30d-559a-49c8-ba5c-2b7f2296615f.png)
When the raid timer begins, viewers on the raiding streamer’s channel will receive a toast notification at the top of the chat area about the impending raid and they are presented with a “Yes/No” option to participate in the raid. By default “Yes” will be selected for the viewers if they do not respond to the toast.![raid-toast](https://user-images.githubusercontent.com/5142625/221441250-428c69c3-c253-4660-8439-579017cef27b.png)
If the streamer cancels the raid, the viewers will all receive this message:![cancel-raid-message](https://user-images.githubusercontent.com/5142625/221441266-ea24d5e4-d9fe-4a88-91e5-225867370c58.png)
4) The raid countdown completes Once the 30 second countdown completes, a scheduled job in the backend will pull all the viewers that had said yes to participating in the raid to the target raid channel. I then call “stop_stream()” on the raiding streamer’s channel which should take them offline (I don’t know if OBS will attempt to reconnect, so we should advise streamers to stop their streams when the raid goes through). The target raid channel will then have their customized “raid event” message posted to the chat.
The raid events are flagged as events in the chat api via a new boolean column “is_raid_message”, so third party bots should be able to detect the event once they are updated to look for it.
Statistics
I’ve added Raid statistics to the statistics page under settings. I track the number of raids for a stream and the total number of viewers that came from those raids for that stream. I’ve also updated the statistics page to only load 30 rows at a time and to use infinite scroll to load additional pages of rows. This should hopefully make the page load faster.![channel-stats](https://user-images.githubusercontent.com/5142625/221441366-874a8c23-c55e-4e80-b61a-3f80b3e47c01.png)
Limitations
Technical Details