Implement Twitch's new raid feature


Twitch has added a new raid feature where the streamer would enter in chat
!raid <channel name>
and a notification will appear in chat too allow others to join the raid.

A 30 second timer appears and once the timer is up everyone who joined the raid will be sent to the channel specified by the streamer. Also the streamer will automatically host that channel.

Phantombot already includes a raid feature, but it only displays a message in chat. Could be a good idea to implement this Twitch feature.

Twitch details the feature here:


so you would want it to /raid when you do !raid? like this


I believe they will work on changing this feature when they have the time.

Here’s a quick fix though:

Option 1: Replace the customized raid message with /raid username.

  1. Open \scripts\systems\raidSystem.js

  2. Find:

     if (command.equalsIgnoreCase('raid')) {
         if (!username) {
             $.say($.whisperPrefix(sender) + $.lang.get(''));
         $.inidb.incr('outgoingRaids', username, 1);
         $.say($.lang.get('', $.username.resolve(username), $.getIniDbString('settings', 'raidMessage', '')));
  3. Replace with:

      * @commandpath raid [channelname] - Announce and register a new outgoing raid
     if (command.equalsIgnoreCase('raid')) {
         if (!username) {
             $.say($.whisperPrefix(sender) + $.lang.get(''));
         $.inidb.incr('outgoingRaids', username, 1);
         //$.say($.lang.get('', $.username.resolve(username), $.getIniDbString('settings', 'raidMessage', '')));
     	$.say('.raid ' + $.user.sanitize(username + ''));
  4. All done.

Option 2: Add /raid username after the custom raid message

  1. Follow all the steps for option 1 (trust me).
  2. Remove the // From //$.say($.lang.get('', $.username.resolve(username), $.getIniDbString('settings', 'raidMessage', ''))); in Step 3 of Option 1.
  3. All done.

If you are wondering why I put .raid instead of /raid, it’s because the bot connects through the api and the irc chat accepts both / and . as command starts. I also used sanitize in case someone uses !raid @name


Yes but I was thinking of using it from the “Hosts & Raids” menu and entering the name of the channel under “Raid Channel”. That would then trigger a /raid


Thanks! I will try those changes.


+1 for this feature making it into the bot! Also I think you can also update the record keeping that tracks incoming raids to use the new raid system via the twitch api?


I’m sure it’s in the works.


The trapping of the incoming event from Twitch was added in November. Will make sure it is on Trello.