File tree Expand file tree Collapse file tree
examples/esp8266/StreamlabsArduinoAlerts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,11 +27,26 @@ void subscriptionEvent(const char * payload) {
2727 Serial.println (payload);
2828}
2929
30+ void resubscriptionEvent (const char * payload) {
31+ Serial.print (" got resubscriptionEvent message: " );
32+ Serial.println (payload);
33+ }
34+
35+ void hostEvent (const char * payload) {
36+ Serial.print (" got hostEvent message: " );
37+ Serial.println (payload);
38+ }
39+
3040void bitsEvent (const char * payload) {
3141 Serial.print (" got bitsEvent message: " );
3242 Serial.println (payload);
3343}
3444
45+ void raidEvent (const char * payload) {
46+ Serial.print (" got raidEvent message: " );
47+ Serial.println (payload);
48+ }
49+
3550void donationsEvent (const char * payload) {
3651 Serial.print (" got donationsEvent message: " );
3752 Serial.println (payload);
@@ -57,7 +72,10 @@ void setup() {
5772
5873 streamlabsAPI.followTwitchEvent (followerEvent);
5974 streamlabsAPI.subscriptionsTwitchEvent (subscriptionEvent);
75+ streamlabsAPI.resubscriptionsTwitchEvent (resubscriptionEvent);
76+ streamlabsAPI.hostTwitchEvent (hostEvent);
6077 streamlabsAPI.bitsTwitchEvent (bitsEvent);
78+ streamlabsAPI.raidTwitchEvent (raidEvent);
6179 streamlabsAPI.donationEvent (donationsEvent);
6280 streamlabsAPI.connect (SOCKET_TOKEN);
6381}
Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ void StreamlabsAPI::subscriptionsTwitchEvent(std::function<void (const char * pa
2121 events[" subscription" ] = func;
2222}
2323
24+ void StreamlabsAPI::resubscriptionsTwitchEvent (std::function<void (const char * payload)> func) {
25+ events[" resub" ] = func;
26+ }
27+
2428void StreamlabsAPI::hostTwitchEvent (std::function<void (const char * payload)> func) {
2529 events[" host" ] = func;
2630}
Original file line number Diff line number Diff line change 22#include < map>
33#include < SocketIOclient.h>
44
5- #if defined( DEBUG_ESP_PORT) || defined(DEBUG_STREAMLABS)
5+ #ifdef DEBUG_ESP_PORT
66#define DEBUG_STREAMLABS_ALERTS (...) \
77 { \
88 DEBUG_ESP_PORT.printf (__VA_ARGS__); \
@@ -30,6 +30,7 @@ class StreamlabsAPI {
3030 void connect (const char * socketToken);
3131 void followTwitchEvent (std::function<void (const char * payload)> func);
3232 void subscriptionsTwitchEvent (std::function<void (const char * payload)> func);
33+ void resubscriptionsTwitchEvent (std::function<void (const char * payload)> func);
3334 void hostTwitchEvent (std::function<void (const char * payload)> func);
3435 void bitsTwitchEvent (std::function<void (const char * payload)> func);
3536 void raidsTwitchEvent (std::function<void (const char * payload)> func);
You can’t perform that action at this time.
0 commit comments