mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-14 13:18:36 -05:00
Add message_text temp var for subscription message event
Some checks failed
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Check locale / ubuntu64 (push) Has been cancelled
Some checks failed
debian-build / build (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Check locale / ubuntu64 (push) Has been cancelled
The existing "message" temp var for the subscription message event contained a raw JSON object (including emote metadata) rather than plain text, making it difficult to use.
This commit is contained in:
@@ -317,6 +317,21 @@ bool MacroConditionTwitch::CheckChannelLiveEvents()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MacroConditionTwitch::CheckChannelSubscriptionMessageEvent()
|
||||
{
|
||||
return HandleMatchingSubscriptionEvents([this](const Event &event) {
|
||||
SetVariableValue(event.ToString());
|
||||
SetJsonTempVars(event.data,
|
||||
[this](const char *id, const char *value) {
|
||||
SetTempVarValue(id, value);
|
||||
});
|
||||
OBSDataAutoRelease message =
|
||||
obs_data_get_obj(event.data, "message");
|
||||
SetTempVarValue("message_text",
|
||||
obs_data_get_string(message, "text"));
|
||||
});
|
||||
}
|
||||
|
||||
bool MacroConditionTwitch::CheckChannelRewardChangeEvents()
|
||||
{
|
||||
return HandleMatchingSubscriptionEvents([this](const Event &event) {
|
||||
@@ -689,7 +704,6 @@ bool MacroConditionTwitch::CheckCondition()
|
||||
case Condition::SUBSCRIPTION_START_EVENT:
|
||||
case Condition::SUBSCRIPTION_END_EVENT:
|
||||
case Condition::SUBSCRIPTION_GIFT_EVENT:
|
||||
case Condition::SUBSCRIPTION_MESSAGE_EVENT:
|
||||
case Condition::CHEER_EVENT:
|
||||
case Condition::RAID_OUTBOUND_EVENT:
|
||||
case Condition::RAID_INBOUND_EVENT:
|
||||
@@ -720,6 +734,8 @@ bool MacroConditionTwitch::CheckCondition()
|
||||
case Condition::USER_MODERATOR_ADDITION_EVENT:
|
||||
case Condition::USER_MODERATOR_DELETION_EVENT:
|
||||
return CheckChannelGenericEvents();
|
||||
case Condition::SUBSCRIPTION_MESSAGE_EVENT:
|
||||
return CheckChannelSubscriptionMessageEvent();
|
||||
case Condition::POINTS_REWARD_ADDITION_EVENT:
|
||||
case Condition::POINTS_REWARD_UPDATE_EVENT:
|
||||
case Condition::POINTS_REWARD_DELETION_EVENT:
|
||||
@@ -1207,6 +1223,7 @@ void MacroConditionTwitch::SetupTempVars()
|
||||
setupTempVarHelper("user_name", ".subscribe.message");
|
||||
setupTempVarHelper("tier", ".subscribe");
|
||||
setupTempVarHelper("message", ".subscribe");
|
||||
setupTempVarHelper("message_text", ".subscribe");
|
||||
setupTempVarHelper("cumulative_months", ".subscribe");
|
||||
setupTempVarHelper("streak_months", ".subscribe");
|
||||
setupTempVarHelper("duration_months", ".subscribe");
|
||||
|
||||
@@ -114,6 +114,7 @@ public:
|
||||
private:
|
||||
bool CheckChannelGenericEvents();
|
||||
bool CheckChannelLiveEvents();
|
||||
bool CheckChannelSubscriptionMessageEvent();
|
||||
bool CheckChannelRewardChangeEvents();
|
||||
bool CheckChannelRewardRedemptionEvents();
|
||||
bool HandleMatchingSubscriptionEvents(
|
||||
|
||||
Reference in New Issue
Block a user