@@ -443,6 +443,54 @@ public function subscribeToChannelGoalEnd(string $bearer, string $secret, string
443
443
return $ this ->subscribeToChannelGoal ($ bearer , $ secret , $ callback , $ twitchId , 'end ' );
444
444
}
445
445
446
+ /**
447
+ * @link https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaignstart
448
+ */
449
+ public function subscribeToChannelCharityCampaignStart (string $ bearer , string $ secret , string $ callback , string $ twitchId ): ResponseInterface
450
+ {
451
+ return $ this ->subscribeToChannelCharityCampaign ($ bearer , $ secret , $ callback , $ twitchId , 'start ' );
452
+ }
453
+
454
+ /**
455
+ * @link https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaignprogress
456
+ */
457
+ public function subscribeToChannelCharityCampaignProgress (string $ bearer , string $ secret , string $ callback , string $ twitchId ): ResponseInterface
458
+ {
459
+ return $ this ->subscribeToChannelCharityCampaign ($ bearer , $ secret , $ callback , $ twitchId , 'progress ' );
460
+ }
461
+
462
+ /**
463
+ * @link https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaignstop
464
+ */
465
+ public function subscribeToChannelCharityCampaignStop (string $ bearer , string $ secret , string $ callback , string $ twitchId ): ResponseInterface
466
+ {
467
+ return $ this ->subscribeToChannelCharityCampaign ($ bearer , $ secret , $ callback , $ twitchId , 'stop ' );
468
+ }
469
+
470
+ /**
471
+ * @link https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelcharity_campaigndonate
472
+ */
473
+ public function subscribeToChannelCharityCampaignDonate (string $ bearer , string $ secret , string $ callback , string $ twitchId ): ResponseInterface
474
+ {
475
+ return $ this ->subscribeToChannelCharityCampaign ($ bearer , $ secret , $ callback , $ twitchId , 'donate ' );
476
+ }
477
+
478
+ /**
479
+ * @link https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshield_modebegin
480
+ */
481
+ public function subscribeToChannelShieldModeBegin (string $ bearer , string $ secret , string $ callback , string $ twitchId , string $ moderatorId ): ResponseInterface
482
+ {
483
+ return $ this ->subscribeToChannelShieldMode ($ bearer , $ secret , $ callback , $ twitchId , $ moderatorId , 'begin ' );
484
+ }
485
+
486
+ /**
487
+ * @link https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshield_modeend
488
+ */
489
+ public function subscribeToChannelShieldModeEnd (string $ bearer , string $ secret , string $ callback , string $ twitchId , string $ moderatorId ): ResponseInterface
490
+ {
491
+ return $ this ->subscribeToChannelShieldMode ($ bearer , $ secret , $ callback , $ twitchId , $ moderatorId , 'end ' );
492
+ }
493
+
446
494
/**
447
495
* @link https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#dropentitlementgrant
448
496
*/
@@ -600,4 +648,31 @@ private function subscribeToChannelGoal(string $bearer, string $secret, string $
600
648
['broadcaster_user_id ' => $ twitchId ],
601
649
);
602
650
}
651
+
652
+ private function subscribeToChannelCharityCampaign (string $ bearer , string $ secret , string $ callback , string $ twitchId , string $ eventType ): ResponseInterface
653
+ {
654
+ return $ this ->createEventSubSubscription (
655
+ $ bearer ,
656
+ $ secret ,
657
+ $ callback ,
658
+ sprintf ('channel.charity_campaign.%s ' , $ eventType ),
659
+ 'beta ' ,
660
+ ['broadcaster_user_id ' => $ twitchId ],
661
+ );
662
+ }
663
+
664
+ private function subscribeToChannelShieldMode (string $ bearer , string $ secret , string $ callback , string $ twitchId , string $ moderatorId , string $ eventType ): ResponseInterface
665
+ {
666
+ return $ this ->createEventSubSubscription (
667
+ $ bearer ,
668
+ $ secret ,
669
+ $ callback ,
670
+ sprintf ('channel.shield_mode.%s ' , $ eventType ),
671
+ 'beta ' ,
672
+ [
673
+ 'broadcaster_user_id ' => $ twitchId ,
674
+ 'moderator_user_id ' => $ moderatorId ,
675
+ ],
676
+ );
677
+ }
603
678
}
0 commit comments