Description
This serves as a foundation for the user to connect their Streamer.Bot client to the Tiltify API and create their own custom donation alerts and stream interactions for their charity events.
Video Tutorial
Requirements
-
Tiltify Account - You will need an account in order to obtain a Client ID and Client Secret. Instructions to do this are in the Tiltify API documentation. You will need this in order to generate an Access Code for Streamer.Bot to communicate with the Tiltify API.
Note: When generating an oAuth application in Tiltify, a Redirect URI is not necessary for this code. It can be set ashttps://localhost
. -
Tiltify Campaign Public ID - This can be found on your campaign page under Setup > Information. The campaign must be published in order for the extension to function properly.
Import Code
Installation
In Streamer.Bot click on the Import
button in the top menu. Drag the .sb file into the Import String
field.
If imported correctly, there should be the following:
Actions
- Tiltify - Access Code
- Tiltify - Recent Donation
- Tiltify - Recent Donation Alert
- Tiltify - Total Raised
Queues
- Tiltify - Access Code
- Tiltify
Configuration
The Tiltify account and campaign information (Client ID, Client Secret, & Public ID) should be entered in their respective sub-actions in the Tiltify - Access Code
action. It is IMPORTANT that this information is entered correctly. If entered properly, an accessCode_Tiltify global variable will be generated with the Access Code provided by Tiltify.
To ensure the Execute Code sub-actions in each action (Tiltify - Access Code
, Tiltify - Recent Donation
, & Tiltify - Total Raised
) have the correct references, click on the Find Refs
and Save and Compile
buttons.
A 2-second timer should be set as the trigger for the Tiltify - Recent Donation
. StreamerBot will then begin poll the Tiltify API every 2 seconds for new donation information.
How It Works
Assuming all actions are enabled and the 2-second timer is set for the Tiltify - Recent Donation
action, StreamerBot will begin polling the Tiltify API every 2 seconds for new donation information. Every donation will have the following variables associated with it:
- donorName - Name assigned to the donation to the Tiltify campaign
- donorAmount - Donation amount (USD) made to the Tiltify campaign
- donationId - Unique identifier assigned by Tiltify to each donation
- donorComment - Message assigned to the donation made by the donor
For every poll, StreamerBot will perform a check if the new donationId matches the previousDonationId. If they are the same, no new donations have been made, but if they are different, the Tiltify - Recent Donation Alert
action will trigger. The previousDonationId_Titlify will be updated to the most recent donationId to be used as a reference for the next poll and prevent dulplicate triggers. This will be followed by subactions related to your own custom alert (see example below).
The Access Code for the Tiltify API expires every 7200 seconds. If an expired code is used, C# code in the Tiltify - Recent Donation
action will detect an error and trigger the Tiltify - Access Code
action to generate a new Access Code and update the global variable accessCode for all actions to use.
The Tiltify - Total Raised
action is optional, but can be used to update the total amount raised for the charity campaign. Additional custom interactions and logic statements can be added here for milestone goals.
Global Variables
The following global variables will be generated and used in the Tiltify integration:
- accessToken_Tiltify- Access token generated from the Client ID and Client Secret. This is requried in order to pull information from the published Tiltify campaign. See Tiltify API Reference for more information.
- publicId_Tiltify - Unique identifier for the published Tiltify campaign. This can be accessed under the Setup tab of the campaign.
- previousDonationId_Tiltify - A unique donationId will be assigned to each donation by Tiltify. This information will be saved under this global variable and used as a reference check every time
Tiltify - Recent Donation
is triggered. If donationId and previousDonationId_Tiltify match, then no new donations have been made andTiltify - Recent Donation Alert
will not be triggered.
References
- Tiltify API Reference - Intro | Tiltify
Changelog
Version 1.8.1
- Quick hotfix in case data polled from Tiltify is null. Added the following line of code (Line 27) in the Execute Code (Tiltify Donor Data) subaction for the
Tiltify - Recent Donation
action to check if data pulled is null. If so, a break in action is triggered and no alert should occur.
Version 1.8
- Moved
Tiltify - Recent Donation
action to Tiltify queue and removedTitlify - Recent Donation Alert
from Tiltify queue. - Simplified subactions for
Tiltify - Recent Donation Alert
action for ease of use - Added comments in
Tiltify - Recent Donation Alert
action for users who are interested in creating their own actions.
- Added comments and sub-action in
Tiltify - Recent Donation
action for users who are interested in creating alert variations based on different donation amounts.
- Timer for
Tiltify - Recent Donation
has been added with Streamer.Bot import file - Simplified subactions for
Tiltify - Total Raised
action. This action can be triggered by being run as a subaction forTiltify - Recent Donation Alert
or similar actions or can be triggered with a command or timer.