Fires whenever a channel publishes a tier on GameWisp

Using Socket.IO this benefit can be listened to as follows:

socket.on('tier-published', function(data){
    //Do stuff.
});

The tier published event is fired whenever a channel publishes a subscriber tier. The tier may be new, or it may a tier that was unpublished and then published again by the channel. The JSON structure of the event is as follows:

{
   event: "tier-published",
   channel_id: "channel-id",
   channel: {
      names: {
         gamewisp: "GameWisp channel name",
         twitch: "twitch channel name",
         youtube: "youtube channel name"
      },
      ids: {
         gamewisp: "channel identifier",
         twitch: "12312312q",
         youtube: "UCiqp4J8asdkssssssssdfae"
      }  
   },
   data: {
      id: "12345",
      title: "Tier Title",
      level: "1",
      cost: "4.00",
      description: "Tier description.",
      published: true,
      subscribers: 0,
      benefits: [
         {
            id: "3",
            delivery: "delivery-messaging",
            title: "Subscriber Messaging",
            description: "Receive Subscriber-only messages from me.",
            channel_data: null,
            type: "unknown-type",
            month_delay: null,
            recurring: false,
            recurring_input: false,
            receieve_immediately: false,
            removed_at: null,
            subscriber_limit: null,
            tier_bonus: false,
            quantity: 1,
            multiplier: 1
         },
         //...
      ]
   }
}

The tier-published event contains the following data Object:

PropertyTypeDescription
idIntegerThe unique identifier of the tier.
titleStringThe title of the tier.
levelIntegerThe level of the tier. Minimum: 1, Maximum:6. This value is null for Twitch tiers.
costString formatted USD amount.The cost of the tier.
descriptionStringThe text description of the tier.
publishedBooleanThe published state of the tier.
subscribersIntegerThe count of subscribers currently in the tier.
benefitsArrayAn array of benefits contained in the tier.

Published tiers can be seen on a channel’s GameWisp page. Subscribers can only be granted benefits from published tiers. However, if a subscriber has benefits for a tier that a channel later sets to unpublished, the subscriber still has access to those benefits since they were in a published tier at the time of subscription. Recurring benefits from an unpublished tier will not recur.