Set temporary variables in Twitch condition

This commit is contained in:
WarmUpTill 2023-11-04 12:35:51 +01:00 committed by WarmUpTill
parent 324d3fe7a5
commit 569b915c07
3 changed files with 768 additions and 3 deletions

View File

@ -1064,6 +1064,336 @@ AdvSceneSwitcher.twitch.selection.points.reward.tooltip.noPermission="Can't sele
AdvSceneSwitcher.twitch.selection.points.reward.tooltip.noChannel="Can't select points reward without entering a channel first!"
AdvSceneSwitcher.twitch.selection.points.reward.tooltip.error="Can't select points reward because Twitch responded with an error! Check OBS logs for more details."
AdvSceneSwitcher.tempVar.select="--select value--"
AdvSceneSwitcher.tempVar.selectionInfo.lastValues="Last values:"
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_id="Twitch broadcaster user id"
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_id.description="The numerical Twitch user ID of the broadcaster."
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_login="Twitch broadcaster user login"
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_login.description="The Twitch user login of the broadcaster"
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_name="Twitch broadcaster user name"
AdvSceneSwitcher.tempVar.twitch.broadcaster_user_name.description="The Twitch user name of the broadcaster"
AdvSceneSwitcher.tempVar.twitch.user_id.follow="Follower Twitch user id"
AdvSceneSwitcher.tempVar.twitch.user_id.follow.description="The user ID for the user now following the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_login.follow="Follower Twitch user login"
AdvSceneSwitcher.tempVar.twitch.user_login.follow.description="The user login for the user now following the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_name.follow="Follower Twitch user name"
AdvSceneSwitcher.tempVar.twitch.user_name.follow.description="The user display name for the user now following the specified channel."
AdvSceneSwitcher.tempVar.twitch.followed_at="Twitch follow timestamp"
AdvSceneSwitcher.tempVar.twitch.followed_at.description="The timestamp of when the Twitch follow event occurred"
AdvSceneSwitcher.tempVar.twitch.id.stream.online="Twitch stream id"
AdvSceneSwitcher.tempVar.twitch.type.stream.online="Twitch stream type"
AdvSceneSwitcher.tempVar.twitch.type.stream.online.description="The stream type. Valid values are: live, playlist, watch_party, premiere, rerun."
AdvSceneSwitcher.tempVar.twitch.started_at.stream.online="Twitch stream start timestamp"
AdvSceneSwitcher.tempVar.twitch.started_at.stream.online.description="The timestamp at which the stream went online at."
AdvSceneSwitcher.tempVar.twitch.title="Twitch stream title"
AdvSceneSwitcher.tempVar.twitch.language="Twitch stream language code"
AdvSceneSwitcher.tempVar.twitch.language.description="The broadcasters preferred language. The value is an ISO 639-1 two-letter language code (for example, en for English). The value is set to “other” if the language is not a Twitch supported language."
AdvSceneSwitcher.tempVar.twitch.category_id="Twitch stream category id"
AdvSceneSwitcher.tempVar.twitch.category_id.description="Numerical id identifying each Twitch streaming category"
AdvSceneSwitcher.tempVar.twitch.category_name="Twitch stream category name"
AdvSceneSwitcher.tempVar.twitch.content_classification_labels="Twitch stream classification labels"
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe="Subscriber Twitch user id"
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.description="The user ID for the user now subscribed to the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe="Subscriber Twitch user login"
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.description="The user login for the user now subscribed to the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_name.subscribe="Subscriber Twitch user name"
AdvSceneSwitcher.tempVar.twitch.user_name.subscribe.description="The user display name for the user now subscribed to the specified channel."
AdvSceneSwitcher.tempVar.twitch.tier.subscribe="Twitch subscriber tier"
AdvSceneSwitcher.tempVar.twitch.tier.subscribe.description="The tier of the subscription. Valid values are 1000, 2000, and 3000."
AdvSceneSwitcher.tempVar.twitch.is_gift.subscribe="Is gifted Twitch subscription"
AdvSceneSwitcher.tempVar.twitch.is_gift.subscribe.description="Valid values are true and false."
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.end="Subscriber Twitch user id"
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.end.description="The user ID for the user no longer subscribed to the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.end="Subscriber Twitch user login"
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.end.description="The user login for the user no longer subscribed to the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_name.subscribe.end="Subscriber Twitch user name"
AdvSceneSwitcher.tempVar.twitch.user_name.subscribe.end.description="The user display name for the user no longer subscribed to the specified channel."
AdvSceneSwitcher.tempVar.twitch.is_gift.subscribe="Was gifted Twitch subscription"
AdvSceneSwitcher.tempVar.twitch.is_gift.subscribe.description="Valid values are true and false."
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.gift="Subscriber Twitch user id"
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.gift.description="The user ID of the user who sent the subscription gift. Set to null if it was an anonymous subscription gift."
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.gift="Subscriber Twitch user login"
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.gift.description="The user login of the user who sent the gift. Set to null if it was an anonymous subscription gift."
AdvSceneSwitcher.tempVar.twitch.user_name.subscribe.gift="Subscriber Twitch user name"
AdvSceneSwitcher.tempVar.twitch.user_name.subscribe.gift.description="The user display name of the user who sent the gift. Set to null if it was an anonymous subscription gift."
AdvSceneSwitcher.tempVar.twitch.total.subscribe="Number of subscriptions"
AdvSceneSwitcher.tempVar.twitch.total.subscribe.description="The number of subscriptions in the subscription gift."
AdvSceneSwitcher.tempVar.twitch.cumulative_total.subscribe="Total gifted subscriptions"
AdvSceneSwitcher.tempVar.twitch.cumulative_total.subscribe.description="The number of subscriptions gifted by this user in the channel. This value is null for anonymous gifts or if the gifter has opted out of sharing this information."
AdvSceneSwitcher.tempVar.twitch.is_anonymous.subscribe="Was anonymous Twitch subscription gift"
AdvSceneSwitcher.tempVar.twitch.is_anonymous.subscribe.description="Valid values are true and false."
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.message="Subscriber Twitch user id"
AdvSceneSwitcher.tempVar.twitch.user_id.subscribe.message.description="The user ID of the user who sent a resubscription chat message."
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.message="Subscriber Twitch user login"
AdvSceneSwitcher.tempVar.twitch.user_login.subscribe.message.description="The user login of the user who sent a resubscription chat message."
AdvSceneSwitcher.tempVar.twitch.user_name.subscribe.message="Subscriber Twitch user name"
AdvSceneSwitcher.tempVar.twitch.user_name.subscribe.message.description="The user display name of the user who a resubscription chat message."
AdvSceneSwitcher.tempVar.twitch.message.subscribe="Subscription message"
AdvSceneSwitcher.tempVar.twitch.message.subscribe.description="An object that contains the resubscription message and emote information needed to recreate the message."
AdvSceneSwitcher.tempVar.twitch.cumulative_months.subscribe="Number of months subscribed"
AdvSceneSwitcher.tempVar.twitch.cumulative_months.subscribe.description="The total number of months the user has been subscribed to the channel."
AdvSceneSwitcher.tempVar.twitch.streak_months.subscribe="Subscription streak"
AdvSceneSwitcher.tempVar.twitch.streak_months.subscribe.description="The number of consecutive months the users current subscription has been active. This value is null if the user has opted out of sharing this information."
AdvSceneSwitcher.tempVar.twitch.duration_months.subscribe="Subscription duration"
AdvSceneSwitcher.tempVar.twitch.duration_months.subscribe.description="The month duration of the subscription."
AdvSceneSwitcher.tempVar.twitch.user_id.cheer="Cheerer Twitch user id"
AdvSceneSwitcher.tempVar.twitch.user_id.cheer.description="The user ID for the user who cheered on the specified channel. This is null if is_anonymous is true."
AdvSceneSwitcher.tempVar.twitch.user_login.cheer="Cheerer Twitch user login"
AdvSceneSwitcher.tempVar.twitch.user_login.cheer.description="The user login for the user who cheered on the specified channel. This is null if is_anonymous is true."
AdvSceneSwitcher.tempVar.twitch.user_name.cheer="Cheerer Twitch user name"
AdvSceneSwitcher.tempVar.twitch.user_name.cheer.description="The user display name for the user who cheered on the specified channel. This is null if is_anonymous is true."
AdvSceneSwitcher.tempVar.twitch.is_anonymous.cheer="Is anonymous cheer"
AdvSceneSwitcher.tempVar.twitch.is_anonymous.cheer.description="Whether the user cheered anonymously or not."
AdvSceneSwitcher.tempVar.twitch.message.cheer="Cheer message"
AdvSceneSwitcher.tempVar.twitch.message.cheer.description="The message sent with the cheer."
AdvSceneSwitcher.tempVar.twitch.bits="Bits amount"
AdvSceneSwitcher.tempVar.twitch.bits.description="The number of bits cheered."
AdvSceneSwitcher.tempVar.twitch.id.poll="Poll ID"
AdvSceneSwitcher.tempVar.twitch.id.poll.description="ID of the poll."
AdvSceneSwitcher.tempVar.twitch.title.poll="Poll title"
AdvSceneSwitcher.tempVar.twitch.title.poll.description="Question displayed for the poll."
AdvSceneSwitcher.tempVar.twitch.choices.poll="Choices"
AdvSceneSwitcher.tempVar.twitch.choices.poll.description="An array of choices for the poll."
AdvSceneSwitcher.tempVar.twitch.choices.pollEnd="Choices"
AdvSceneSwitcher.tempVar.twitch.choices.pollEnd.description="An array of choices for the poll. Includes vote counts."
AdvSceneSwitcher.tempVar.twitch.channel_points_voting.description="Channel points voting setting"
AdvSceneSwitcher.tempVar.twitch.channel_points_voting.description="The Channel Points voting settings for the poll."
AdvSceneSwitcher.tempVar.twitch.started_at.poll="Poll start time"
AdvSceneSwitcher.tempVar.twitch.ends_at.poll="Poll end time"
AdvSceneSwitcher.tempVar.twitch.status.poll="Poll status"
AdvSceneSwitcher.tempVar.twitch.status.poll.description="The status of the poll. Valid values are completed, archived, and terminated."
AdvSceneSwitcher.tempVar.twitch.id.prediction="Prediction ID"
AdvSceneSwitcher.tempVar.twitch.id.prediction.description="Channel Points Prediction ID."
AdvSceneSwitcher.tempVar.twitch.title.prediction="Prediction title"
AdvSceneSwitcher.tempVar.twitch.title.prediction.description="Title for the Channel Points Prediction."
AdvSceneSwitcher.tempVar.twitch.outcomes.prediction="Prediction outcomes"
AdvSceneSwitcher.tempVar.twitch.outcomes.prediction.description="An array of outcomes for the Channel Points Prediction. Includes top_predictors."
AdvSceneSwitcher.tempVar.twitch.started_at.prediction="Prediction start time"
AdvSceneSwitcher.tempVar.twitch.locks_at.prediction="Prediction lock time"
AdvSceneSwitcher.tempVar.twitch.ended_at.prediction="Prediction end time"
AdvSceneSwitcher.tempVar.twitch.status.prediction="Prediction status"
AdvSceneSwitcher.tempVar.twitch.status.prediction.description="The status of the Channel Points Prediction. Valid values are resolved and canceled."
AdvSceneSwitcher.tempVar.twitch.id.goal="Goal ID"
AdvSceneSwitcher.tempVar.twitch.type.goal="Goal type"
AdvSceneSwitcher.tempVar.twitch.type.goal.description="The type of goal. Possible values are:\n
follow — The goal is to increase followers.\n
subscription — The goal is to increase subscriptions. This type shows the net increase or decrease in tier points associated with the subscriptions.\n
subscription_count — The goal is to increase subscriptions. This type shows the net increase or decrease in the number of subscriptions.\n
new_subscription — The goal is to increase subscriptions. This type shows only the net increase in tier points associated with the subscriptions (it does not account for users that unsubscribed since the goal started).\n
new_subscription_count — The goal is to increase subscriptions. This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started)."
AdvSceneSwitcher.tempVar.twitch.description.goal="Goal description"
AdvSceneSwitcher.tempVar.twitch.description.goal.description="A description of the goal, if specified. The description may contain a maximum of 40 characters."
AdvSceneSwitcher.tempVar.twitch.is_achieved.goal="Goal is achieved"
AdvSceneSwitcher.tempVar.twitch.is_achieved.goal.description="A Boolean value that indicates whether the broadcaster achieved their goal. Is true if the goal was achieved; otherwise, false."
AdvSceneSwitcher.tempVar.twitch.current_amount.goal="Goal current amount"
AdvSceneSwitcher.tempVar.twitch.current_amount.goal.description="The goal's current value.\n
The goal's type determines how this value is increased or decreased.\n
If type is follow, this field is set to the broadcaster's current number of followers. This number increases with new followers and decreases when users unfollow the broadcaster.\n
If type is subscription, this field is increased and decreased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1.\n
If type is subscription_count, this field is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes.\n
If type is new_subscription, this field is increased by the points value associated with the subscription tier. For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1.\n
If type is new_subscription_count, this field is increased by 1 for each new subscription."
AdvSceneSwitcher.tempVar.twitch.target_amount.goal="Goal target amount"
AdvSceneSwitcher.tempVar.twitch.target_amount.goal.description="The goal's target value. For example, if the broadcaster has 200 followers before creating the goal, and their goal is to double that number, this field is set to 400."
AdvSceneSwitcher.tempVar.twitch.started_at.goal="Goal start time"
AdvSceneSwitcher.tempVar.twitch.ended_at.goal="Goal end time"
AdvSceneSwitcher.tempVar.twitch.id.hype="Hype train ID"
AdvSceneSwitcher.tempVar.twitch.total.hype="Hype train total points"
AdvSceneSwitcher.tempVar.twitch.total.hype.description="Total points contributed to the Hype Train."
AdvSceneSwitcher.tempVar.twitch.progress.hype="Hype train progress"
AdvSceneSwitcher.tempVar.twitch.progress.hype.description="The number of points contributed to the Hype Train at the current level."
AdvSceneSwitcher.tempVar.twitch.goal.hype="Hype train goal"
AdvSceneSwitcher.tempVar.twitch.goal.hype.description="The number of points required to reach the next level."
AdvSceneSwitcher.tempVar.twitch.top_contributions.hype="Hype train top contributors"
AdvSceneSwitcher.tempVar.twitch.top_contributions.hype.description="The contributors with the most points contributed."
AdvSceneSwitcher.tempVar.twitch.last_contribution.hype="Hype train last contributor"
AdvSceneSwitcher.tempVar.twitch.last_contribution.hype.description="The most recent contribution."
AdvSceneSwitcher.tempVar.twitch.level.hype="Hype train level"
AdvSceneSwitcher.tempVar.twitch.started_at.hype="Hype train start time"
AdvSceneSwitcher.tempVar.twitch.expires_at.hype="Hype train expiration time"
AdvSceneSwitcher.tempVar.twitch.ended_at.hype="Hype train end time"
AdvSceneSwitcher.tempVar.twitch.cooldown_ends_at.hype="Hype train cooldown"
AdvSceneSwitcher.tempVar.twitch.cooldown_ends_at.hype.description="The time when the Hype Train cooldown ends so that the next Hype Train can start."
AdvSceneSwitcher.tempVar.twitch.to_broadcaster_user_id.shoutout="User ID (shouted out)"
AdvSceneSwitcher.tempVar.twitch.to_broadcaster_user_id.shoutout.description="An ID that identifies the broadcaster that received the Shoutout."
AdvSceneSwitcher.tempVar.twitch.to_broadcaster_user_login.shoutout="User login (shouted out)"
AdvSceneSwitcher.tempVar.twitch.to_broadcaster_user_login.shoutout.description="The user login that identifies the broadcaster that received the Shoutout."
AdvSceneSwitcher.tempVar.twitch.to_broadcaster_user_name.shoutout="User name (shouted out)"
AdvSceneSwitcher.tempVar.twitch.to_broadcaster_user_name.shoutout.description="The user name that identifies the broadcaster that received the Shoutout."
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.shoutout="User ID triggering shouting out"
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.shoutout.description="An ID that identifies the moderator that sent the Shoutout. If the broadcaster sent the Shoutout, this ID is the same as the ID in broadcaster_user_id."
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.shoutout="User login triggering shouting out"
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.shoutout.description="The user login that identifies the moderator that sent the Shoutout. If the broadcaster sent the Shoutout, this ID is the same as the ID in broadcaster_user_id."
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.shoutout="User name triggering shouting out"
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.shoutout.description="The user login that identifies the moderator that sent the Shoutout. If the broadcaster sent the Shoutout, this ID is the same as the ID in broadcaster_user_id."
AdvSceneSwitcher.tempVar.twitch.viewer_count.shoutout="Viewer count"
AdvSceneSwitcher.tempVar.twitch.viewer_count.shoutout.description="The number of users that were watching the broadcaster's stream at the time of the Shoutout."
AdvSceneSwitcher.tempVar.twitch.started_at.shoutout="Shoutout start time"
AdvSceneSwitcher.tempVar.twitch.started_at.shoutout.description="The UTC timestamp (in RFC3339 format) of when the moderator sent the Shoutout."
AdvSceneSwitcher.tempVar.twitch.cooldown_ends_at.shoutout="Shoutout cooldown end time"
AdvSceneSwitcher.tempVar.twitch.cooldown_ends_at.shoutout.description="The UTC timestamp (in RFC3339 format) of when the broadcaster may send a Shoutout to a different broadcaster."
AdvSceneSwitcher.tempVar.twitch.target_cooldown_ends_at.shoutout="Shoutout target cooldown end time"
AdvSceneSwitcher.tempVar.twitch.target_cooldown_ends_at.shoutout.description="The UTC timestamp (in RFC3339 format) of when the broadcaster may send another Shoutout to the selected broadcaster."
AdvSceneSwitcher.tempVar.twitch.from_broadcaster_user_id.shoutoutReceived="User ID shouting out"
AdvSceneSwitcher.tempVar.twitch.from_broadcaster_user_id.shoutoutReceived.description="An ID that identifies the broadcaster that received the Shoutout."
AdvSceneSwitcher.tempVar.twitch.from_broadcaster_user_login.shoutoutReceived="User login shouting out"
AdvSceneSwitcher.tempVar.twitch.from_broadcaster_user_login.shoutoutReceived.description="The user login that identifies the broadcaster that received the Shoutout."
AdvSceneSwitcher.tempVar.twitch.from_broadcaster_user_name.shoutoutReceived="User name shouting out"
AdvSceneSwitcher.tempVar.twitch.from_broadcaster_user_name.shoutoutReceived.description="The user name that identifies the broadcaster that received the Shoutout."
AdvSceneSwitcher.tempVar.twitch.viewer_count.shoutoutReceived="Viewer count"
AdvSceneSwitcher.tempVar.twitch.viewer_count.shoutoutReceived.description="The number of users that were watching the from-broadcaster's stream at the time of the Shoutout."
AdvSceneSwitcher.tempVar.twitch.started_at.shoutoutReceived="Shoutout time"
AdvSceneSwitcher.tempVar.twitch.started_at.shoutoutReceived.description="The UTC timestamp (in RFC3339 format) of when the moderator sent the Shoutout."
AdvSceneSwitcher.tempVar.twitch.id.reward="Reward id"
AdvSceneSwitcher.tempVar.twitch.user_id.reward="User id redeeming reward"
AdvSceneSwitcher.tempVar.twitch.user_login.reward="User login redeeming reward"
AdvSceneSwitcher.tempVar.twitch.user_name.reward="User login redeeming reward"
AdvSceneSwitcher.tempVar.twitch.user_input.reward="User input for reward"
AdvSceneSwitcher.tempVar.twitch.reward.reward="Reward Information"
AdvSceneSwitcher.tempVar.twitch.reward.reward.description="Basic information about the reward that was redeemed, at the time it was redeemed."
AdvSceneSwitcher.tempVar.twitch.status.reward="Reward status"
AdvSceneSwitcher.tempVar.twitch.status.reward.description="Defaults to unfulfilled. Possible values are unknown, unfulfilled, fulfilled, and canceled."
AdvSceneSwitcher.tempVar.twitch.redeemed_at.reward="Redemption time"
AdvSceneSwitcher.tempVar.twitch.redeemed_at.reward.description="RFC3339 timestamp of when the reward was redeemed."
AdvSceneSwitcher.tempVar.twitch.is_enabled.reward="Reward is enabled"
AdvSceneSwitcher.tempVar.twitch.is_enabled.reward.description="Is the reward currently enabled. If false, the reward wont show up to viewers."
AdvSceneSwitcher.tempVar.twitch.is_paused.reward="Reward is paused"
AdvSceneSwitcher.tempVar.twitch.is_paused.reward.description="Is the reward currently paused. If true, viewers cant redeem."
AdvSceneSwitcher.tempVar.twitch.is_in_stock.reward="Reward is in stock"
AdvSceneSwitcher.tempVar.twitch.is_in_stock.reward.description="Is the reward currently in stock. If false, viewers cant redeem."
AdvSceneSwitcher.tempVar.twitch.title.reward="Reward title"
AdvSceneSwitcher.tempVar.twitch.cost.reward="Reward cost"
AdvSceneSwitcher.tempVar.twitch.prompt.reward="Reward description"
AdvSceneSwitcher.tempVar.twitch.is_user_input_required.reward="Reward requires user input"
AdvSceneSwitcher.tempVar.twitch.should_redemptions_skip_request_queue.reward="Redemptions skip request queue"
AdvSceneSwitcher.tempVar.twitch.should_redemptions_skip_request_queue.reward.description="Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status."
AdvSceneSwitcher.tempVar.twitch.max_per_stream.reward="Reward maximum per stream"
AdvSceneSwitcher.tempVar.twitch.max_per_user_per_stream.reward="Reward maximum per user per stream"
AdvSceneSwitcher.tempVar.twitch.background_color.reward="Reward background color"
AdvSceneSwitcher.tempVar.twitch.image.reward="Reward image"
AdvSceneSwitcher.tempVar.twitch.image.reward.description="Set of custom images of 1x, 2x and 4x sizes for the reward. Can be null if no images have been uploaded."
AdvSceneSwitcher.tempVar.twitch.default_image.reward="Reward default image"
AdvSceneSwitcher.tempVar.twitch.default_image.reward.description="Set of default images of 1x, 2x and 4x sizes for the reward."
AdvSceneSwitcher.tempVar.twitch.global_cooldown.reward="Reward cooldown"
AdvSceneSwitcher.tempVar.twitch.global_cooldown.reward.description="Whether a cooldown is enabled and what the cooldown is in seconds."
AdvSceneSwitcher.tempVar.twitch.cooldown_expires_at.reward="Reward cooldown expiration"
AdvSceneSwitcher.tempVar.twitch.cooldown_expires_at.reward.description="Timestamp of the cooldown expiration. null if the reward isnt on cooldown."
AdvSceneSwitcher.tempVar.twitch.redemptions_redeemed_current_stream.reward="Redemption count"
AdvSceneSwitcher.tempVar.twitch.redemptions_redeemed_current_stream.reward.description="The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit. null if the broadcasters stream isnt live or max_per_stream isnt enabled."
AdvSceneSwitcher.tempVar.twitch.redemptions_redeemed_current_stream.reward.description="The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit. null if the broadcasters stream isnt live or max_per_stream isnt enabled."
AdvSceneSwitcher.tempVar.twitch.charity_name="Charity name"
AdvSceneSwitcher.tempVar.twitch.charity_description="Charity description"
AdvSceneSwitcher.tempVar.twitch.charity_logo="Charity logo"
AdvSceneSwitcher.tempVar.twitch.charity_logo.description="A URL to an image of the charitys logo. The images type is PNG and its size is 100px X 100px."
AdvSceneSwitcher.tempVar.twitch.id.charity="Charity id"
AdvSceneSwitcher.tempVar.twitch.id.charity.description="An ID that identifies the donation. The ID is unique across campaigns."
AdvSceneSwitcher.tempVar.twitch.user_id.charity="Donor user id"
AdvSceneSwitcher.tempVar.twitch.user_id.charity.description="An ID that identifies the user that donated to the campaign."
AdvSceneSwitcher.tempVar.twitch.user_login.charity="Donor login name"
AdvSceneSwitcher.tempVar.twitch.user_login.charity.description="The user login that identifies the user that donated to the campaign."
AdvSceneSwitcher.tempVar.twitch.user_name.charity="Donor user name"
AdvSceneSwitcher.tempVar.twitch.user_name.charity.description="The user name that identifies the user that donated to the campaign."
AdvSceneSwitcher.tempVar.twitch.amount.charity="Donation amount"
AdvSceneSwitcher.tempVar.twitch.amount.charity.description="An object that contains the amount of money that the user donated."
AdvSceneSwitcher.tempVar.twitch.current_amount.charity="Current donation amount"
AdvSceneSwitcher.tempVar.twitch.current_amount.charity.description="An object that contains the current amount of donations that the campaign has received."
AdvSceneSwitcher.tempVar.twitch.target_amount.charity="Charity target amount"
AdvSceneSwitcher.tempVar.twitch.target_amount.charity.description="An object that contains the campaigns target fundraising goal."
AdvSceneSwitcher.tempVar.twitch.started_at.charity="Charity start date"
AdvSceneSwitcher.tempVar.twitch.started_at.charity.description="The UTC timestamp (in RFC3339 format) of when the broadcaster started the charity campaign."
AdvSceneSwitcher.tempVar.twitch.stopped_at.charity="Charity start date"
AdvSceneSwitcher.tempVar.twitch.stopped_at.charity.description="The UTC timestamp (in RFC3339 format) of when the broadcaster stopped the campaign."
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.shieldMode="Moderator user ID"
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.shieldMode.description="An ID that identifies the moderator that updated the Shield Modes status. If the broadcaster updated the status, this ID will be the same as the broadcaster's ID"
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.shieldMode="Moderator login name"
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.shieldMode.description="Login name that identifies the moderator that updated the Shield Modes status. If the broadcaster updated the status, this login name will be the same as the broadcaster's login name"
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.shieldMode="Moderator user name"
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.shieldMode.description="User name that identifies the moderator that updated the Shield Modes status. If the broadcaster updated the status, this user name will be the same as the broadcaster's user name"
AdvSceneSwitcher.tempVar.twitch.started_at.shieldMode="Shield Mode start time"
AdvSceneSwitcher.tempVar.twitch.started_at.shieldMode.description="The UTC timestamp (in RFC3339 format) of when the moderator activated Shield Mode."
AdvSceneSwitcher.tempVar.twitch.ended_at.shieldMode="Shield Mode end time"
AdvSceneSwitcher.tempVar.twitch.ended_at.shieldMode.description="The UTC timestamp (in RFC3339 format) of when the moderator deactivated Shield Mode."
AdvSceneSwitcher.tempVar.twitch.game_name="Game name"
AdvSceneSwitcher.tempVar.twitch.game_name.description="The name of the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game."
AdvSceneSwitcher.tempVar.twitch.game_id="Game ID"
AdvSceneSwitcher.tempVar.twitch.game_id.description="An ID that uniquely identifies the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game."
AdvSceneSwitcher.tempVar.twitch.delay="Stream delay"
AdvSceneSwitcher.tempVar.twitch.delay.description="The value of the broadcasters stream delay setting, in seconds.\nThis fields value defaults to zero unless 1) the request specifies a user access token, 2) the ID in the broadcaster_id query parameter matches the user ID in the access token, and 3) the broadcaster has partner status and they set a non-zero stream delay value."
AdvSceneSwitcher.tempVar.twitch.tags="Stream tags"
AdvSceneSwitcher.tempVar.twitch.tags.description="The tags applied to the channel."
AdvSceneSwitcher.tempVar.twitch.is_mature="Is mature content"
AdvSceneSwitcher.tempVar.twitch.is_mature.description="A Boolean value that indicates whether the stream is meant for mature audiences."
AdvSceneSwitcher.tempVar.twitch.is_branded_content="Is branded content"
AdvSceneSwitcher.tempVar.twitch.is_branded_content.description="Boolean flag indicating if the channel has branded content."
AdvSceneSwitcher.tempVar.twitch.thumbnail_url="Thumbnail URL"
AdvSceneSwitcher.tempVar.twitch.thumbnail_url.description="A URL to an image of a frame from the last 5 minutes of the stream. Replace the width and height placeholders in the URL ({width}x{height}) with the size of the image you want, in pixels."
AdvSceneSwitcher.tempVar.twitch.viewer_count.live="Viewer count"
AdvSceneSwitcher.tempVar.twitch.viewer_count.live.description="The number of users watching the stream."
AdvSceneSwitcher.tempVar.twitch.user_id.ban="Banned user id"
AdvSceneSwitcher.tempVar.twitch.user_id.ban.description="The user ID for the user who was banned on the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_login.ban="Banned login name"
AdvSceneSwitcher.tempVar.twitch.user_login.ban.description="The user login for the user who was banned on the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_name.ban="Banned user name"
AdvSceneSwitcher.tempVar.twitch.user_name.ban.description="The user display name for the user who was banned on the specified channel."
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.ban="Moderator user id"
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.ban.description="The user ID of the issuer of the ban."
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.ban="Moderator login name"
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.ban.description="The user login of the issuer of the ban."
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.ban="Moderator user name"
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.ban.description="The user name of the issuer of the ban."
AdvSceneSwitcher.tempVar.twitch.reason.ban="Ban reason"
AdvSceneSwitcher.tempVar.twitch.ends_at.ban="Ban end date"
AdvSceneSwitcher.tempVar.twitch.ends_at.ban.description="The UTC date and time (in RFC3339 format) of when the timeout ends. Is null if the user was banned instead of put in a timeout."
AdvSceneSwitcher.tempVar.twitch.is_permanent.ban="Is permanent ban"
AdvSceneSwitcher.tempVar.twitch.is_permanent.ban.description="Indicates whether the ban is permanent (true) or a timeout (false). If true, ends_at will be null."
AdvSceneSwitcher.tempVar.twitch.user_id.unban="Banned user id"
AdvSceneSwitcher.tempVar.twitch.user_id.unban.description="The user ID for the user who was unbanned on the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_login.unban="Banned login name"
AdvSceneSwitcher.tempVar.twitch.user_login.unban.description="The user login for the user who was unbanned on the specified channel."
AdvSceneSwitcher.tempVar.twitch.user_name.unban="Banned user name"
AdvSceneSwitcher.tempVar.twitch.user_name.unban.description="The user display name for the user who was unbanned on the specified channel."
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.unban="Moderator user id"
AdvSceneSwitcher.tempVar.twitch.moderator_user_id.unban.description="The user ID of the issuer of the unban."
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.unban="Moderator login name"
AdvSceneSwitcher.tempVar.twitch.moderator_user_login.unban.description="The user login of the issuer of the unban."
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.unban="Moderator user name"
AdvSceneSwitcher.tempVar.twitch.moderator_user_name.unban.description="The user name of the issuer of the unban."
AdvSceneSwitcher.tempVar.twitch.user_id.addMod="User id"
AdvSceneSwitcher.tempVar.twitch.user_id.addMod.description="The user ID of the new moderator."
AdvSceneSwitcher.tempVar.twitch.user_login.addMod="Login name"
AdvSceneSwitcher.tempVar.twitch.user_login.addMod.description="The user login of the new moderator."
AdvSceneSwitcher.tempVar.twitch.user_name.addMod="User name"
AdvSceneSwitcher.tempVar.twitch.user_name.addMod.description="The display name of the new moderator."
AdvSceneSwitcher.tempVar.twitch.user_id.removeMod="User id"
AdvSceneSwitcher.tempVar.twitch.user_id.removeMod.description="The user ID of the removed moderator."
AdvSceneSwitcher.tempVar.twitch.user_login.removeMod="Login name"
AdvSceneSwitcher.tempVar.twitch.user_login.removeMod.description="The user login of the removed moderator."
AdvSceneSwitcher.tempVar.twitch.user_name.removeMod="User name"
AdvSceneSwitcher.tempVar.twitch.user_name.removeMod.description="The display name of the removed moderator."
AdvSceneSwitcher.selectScene="--select scene--"
AdvSceneSwitcher.selectPreviousScene="Previous Scene"
AdvSceneSwitcher.selectCurrentScene="Current Scene"

View File

@ -3,6 +3,7 @@
#include <log-helper.hpp>
#include <utility.hpp>
#include <nlohmann/json.hpp>
namespace advss {
@ -222,6 +223,7 @@ const static std::map<MacroConditionTwitch::Condition, std::string>
void MacroConditionTwitch::SetCondition(const Condition &condition)
{
_condition = condition;
SetupTempVars();
ResetSubscription();
}
@ -238,6 +240,38 @@ void MacroConditionTwitch::SetPointsReward(
ResetSubscription();
}
static void
setTempVarsHelper(const std::string &jsonStr,
std::function<void(const char *, const char *)> setVar)
{
try {
auto json = nlohmann::json::parse(jsonStr);
for (auto it = json.begin(); it != json.end(); ++it) {
if (it->is_string()) {
setVar(it.key().c_str(),
it->get<std::string>().c_str());
continue;
}
setVar(it.key().c_str(), it->dump().c_str());
}
} catch (const nlohmann::json::exception &e) {
vblog(LOG_INFO, "%s", jsonStr.c_str());
vblog(LOG_INFO, "%s", e.what());
}
}
static void
setTempVarsHelper(obs_data_t *data,
std::function<void(const char *, const char *)> setVar)
{
auto jsonStr = obs_data_get_json(data);
if (!jsonStr) {
return;
}
setTempVarsHelper(jsonStr, setVar);
}
bool MacroConditionTwitch::CheckChannelGenericEvents(TwitchToken &token)
{
auto eventSub = token.GetEventSub();
@ -247,10 +281,16 @@ bool MacroConditionTwitch::CheckChannelGenericEvents(TwitchToken &token)
auto events = eventSub->Events();
for (const auto &event : events) {
if (_subscriptionID == event.id) {
SetVariableValue(event.ToString());
return true;
if (_subscriptionID != event.id) {
continue;
}
SetVariableValue(event.ToString());
setTempVarsHelper(
event.data,
std::bind(&MacroConditionTwitch::SetTempVarValue, this,
std::placeholders::_1,
std::placeholders::_2));
return true;
}
return false;
@ -281,6 +321,11 @@ bool MacroConditionTwitch::CheckChannelLiveEvents(TwitchToken &token)
}
SetVariableValue(event.ToString());
setTempVarsHelper(
event.data,
std::bind(&MacroConditionTwitch::SetTempVarValue, this,
std::placeholders::_1,
std::placeholders::_2));
return true;
}
@ -302,6 +347,60 @@ static bool titleMatches(const RegexConfig &conf, const std::string &title,
return match.hasMatch();
}
void MacroConditionTwitch::SetTempVarValues(const ChannelLiveInfo &info)
{
SetTempVarValue("broadcaster_user_id", info.user_id);
SetTempVarValue("broadcaster_user_login", info.user_login);
SetTempVarValue("broadcaster_user_name", info.user_name);
SetTempVarValue("id", info.id);
SetTempVarValue("game_id", info.game_id);
SetTempVarValue("game_name", info.game_name);
SetTempVarValue("title", info.title);
std::string tags;
for (const auto &tag : info.tags) {
tags += tag + " ";
}
if (!tags.empty()) {
tags.pop_back();
}
SetTempVarValue("tags", tags);
SetTempVarValue("viewer_count", std::to_string(info.viewer_count));
SetTempVarValue("started_at", info.started_at.toString().toStdString());
SetTempVarValue("language", info.language);
SetTempVarValue("thumbnail_url", info.thumbnail_url);
SetTempVarValue("is_mature", info.is_mature ? "true" : "false");
}
void MacroConditionTwitch::SetTempVarValues(const ChannelInfo &info)
{
SetTempVarValue("broadcaster_user_id", info.broadcaster_id);
SetTempVarValue("broadcaster_user_login", info.broadcaster_login);
SetTempVarValue("broadcaster_user_name", info.broadcaster_name);
SetTempVarValue("language", info.broadcaster_language);
SetTempVarValue("game_id", info.game_id);
SetTempVarValue("game_name", info.game_name);
SetTempVarValue("title", info.title);
SetTempVarValue("delay", std::to_string(info.delay));
std::string tags;
for (const auto &tag : info.tags) {
tags += tag + " ";
}
if (!tags.empty()) {
tags.pop_back();
}
SetTempVarValue("tags", tags);
std::string classificationLabels;
for (const auto &label : info.content_classification_labels) {
classificationLabels += label + " ";
}
if (!classificationLabels.empty()) {
classificationLabels.pop_back();
}
SetTempVarValue("content_classification_labels", tags);
SetTempVarValue("is_branded_content",
info.is_branded_content ? "true" : "false");
}
bool MacroConditionTwitch::CheckCondition()
{
SetVariableValue("");
@ -377,6 +476,8 @@ bool MacroConditionTwitch::CheckCondition()
if (!info) {
return false;
}
SetTempVarValues(*info);
return info->IsLive();
}
case Condition::TITLE_POLLING: {
@ -385,6 +486,7 @@ bool MacroConditionTwitch::CheckCondition()
return false;
}
SetVariableValue(info->title);
SetTempVarValues(*info);
return titleMatches(_regex, info->title, _streamTitle);
}
case Condition::CATEGORY_POLLING: {
@ -393,6 +495,7 @@ bool MacroConditionTwitch::CheckCondition()
return false;
}
SetVariableValue(info->game_name);
SetTempVarValues(*info);
return info->game_id == std::to_string(_category.id);
}
default:
@ -699,6 +802,331 @@ void MacroConditionTwitch::AddChannelGenericEventSubscription(
_subscriptionIDFuture = waitForSubscription(token, subscription);
}
static std::string tryTranslate(const std::string &testString)
{
auto translated = obs_module_text(testString.c_str());
if (testString != translated) {
return translated;
}
return "";
}
void MacroConditionTwitch::SetupTempVars()
{
MacroCondition::SetupTempVars();
auto setupTempVarHelper = [&](const std::string &id,
const std::string &extra = "") {
std::string name = tryTranslate(
"AdvSceneSwitcher.tempVar.twitch." + id + extra);
std::string description =
tryTranslate("AdvSceneSwitcher.tempVar.twitch." + id +
extra + ".description");
AddTempvar(id, name.empty() ? id : name, description);
};
setupTempVarHelper("broadcaster_user_id");
setupTempVarHelper("broadcaster_user_login");
setupTempVarHelper("broadcaster_user_name");
switch (_condition) {
case Condition::STREAM_ONLINE_LIVE_EVENT:
case Condition::STREAM_ONLINE_PLAYLIST_EVENT:
case Condition::STREAM_ONLINE_WATCHPARTY_EVENT:
case Condition::STREAM_ONLINE_PREMIERE_EVENT:
case Condition::STREAM_ONLINE_RERUN_EVENT:
case Condition::STREAM_ONLINE_EVENT:
setupTempVarHelper("id", ".stream.online");
setupTempVarHelper("type", ".stream.online");
setupTempVarHelper("started_at", ".stream.online");
break;
case Condition::STREAM_OFFLINE_EVENT:
break;
case Condition::SUBSCRIPTION_START_EVENT:
setupTempVarHelper("user_id", ".subscribe");
setupTempVarHelper("user_login", ".subscribe");
setupTempVarHelper("user_name", ".subscribe");
setupTempVarHelper("tier", ".subscribe");
setupTempVarHelper("is_gift", ".subscribe");
break;
case Condition::SUBSCRIPTION_END_EVENT:
setupTempVarHelper("user_id", ".subscribe.end");
setupTempVarHelper("user_login", ".subscribe.end");
setupTempVarHelper("user_name", ".subscribe.end");
setupTempVarHelper("tier", ".subscribe");
setupTempVarHelper("is_gift", ".subscribe.end");
break;
case Condition::SUBSCRIPTION_GIFT_EVENT:
setupTempVarHelper("user_id", ".subscribe.gift");
setupTempVarHelper("user_login", ".subscribe.gift");
setupTempVarHelper("user_name", ".subscribe.gift");
setupTempVarHelper("tier", ".subscribe");
setupTempVarHelper("total", ".subscribe");
setupTempVarHelper("cumulative_total", ".subscribe");
setupTempVarHelper("is_anonymous", ".subscribe");
break;
case Condition::SUBSCRIPTION_MESSAGE_EVENT:
setupTempVarHelper("user_id", ".subscribe.message");
setupTempVarHelper("user_login", ".subscribe.message");
setupTempVarHelper("user_name", ".subscribe.message");
setupTempVarHelper("tier", ".subscribe");
setupTempVarHelper("message", ".subscribe");
setupTempVarHelper("cumulative_months", ".subscribe");
setupTempVarHelper("streak_months", ".subscribe");
setupTempVarHelper("duration_months", ".subscribe");
break;
case Condition::CHEER_EVENT:
setupTempVarHelper("user_id", ".cheer");
setupTempVarHelper("user_login", ".cheer");
setupTempVarHelper("user_name", ".cheer");
setupTempVarHelper("is_anonymous", ".cheer");
setupTempVarHelper("message", ".cheer");
setupTempVarHelper("bits");
break;
case Condition::POLL_START_EVENT:
case Condition::POLL_PROGRESS_EVENT:
setupTempVarHelper("id", ".poll");
setupTempVarHelper("title", ".poll");
setupTempVarHelper("choices", ".poll");
setupTempVarHelper("channel_points_voting");
setupTempVarHelper("started_at", ".poll");
setupTempVarHelper("ends_at", ".poll");
break;
case Condition::POLL_END_EVENT:
setupTempVarHelper("id", ".poll");
setupTempVarHelper("title", ".poll");
setupTempVarHelper("choices", ".pollEnd");
setupTempVarHelper("channel_points_voting");
setupTempVarHelper("started_at", ".poll");
setupTempVarHelper("ends_at", ".poll");
setupTempVarHelper("status", ".poll");
break;
case Condition::PREDICTION_START_EVENT:
case Condition::PREDICTION_PROGRESS_EVENT:
case Condition::PREDICTION_LOCK_EVENT:
setupTempVarHelper("id", ".prediction");
setupTempVarHelper("title", ".prediction");
setupTempVarHelper("outcomes", ".prediction");
setupTempVarHelper("started_at", ".prediction");
setupTempVarHelper("locks_at", ".prediction");
break;
case Condition::PREDICTION_END_EVENT:
setupTempVarHelper("id", ".prediction");
setupTempVarHelper("title", ".prediction");
setupTempVarHelper("outcomes", ".prediction");
setupTempVarHelper("started_at", ".prediction");
setupTempVarHelper("locks_at", ".prediction");
setupTempVarHelper("ended_at", ".prediction");
setupTempVarHelper("status", ".prediction");
break;
case Condition::GOAL_START_EVENT:
case Condition::GOAL_PROGRESS_EVENT:
case Condition::GOAL_END_EVENT:
setupTempVarHelper("id", ".goal");
setupTempVarHelper("type", ".goal");
setupTempVarHelper("description", ".goal");
setupTempVarHelper("is_achieved", ".goal");
setupTempVarHelper("current_amount", ".goal");
setupTempVarHelper("target_amount", ".goal");
setupTempVarHelper("started_at", ".goal");
setupTempVarHelper("ended_at", ".goal");
break;
case Condition::HYPE_TRAIN_START_EVENT:
case Condition::HYPE_TRAIN_PROGRESS_EVENT:
setupTempVarHelper("id", ".hype");
setupTempVarHelper("total", ".hype");
setupTempVarHelper("progress", ".hype");
setupTempVarHelper("goal", ".hype");
setupTempVarHelper("top_contributions", ".hype");
setupTempVarHelper("last_contribution", ".hype");
setupTempVarHelper("level", ".hype");
setupTempVarHelper("started_at", ".hype");
setupTempVarHelper("expires_at", ".hype");
break;
case Condition::HYPE_TRAIN_END_EVENT:
setupTempVarHelper("id", ".hype");
setupTempVarHelper("total", ".hype");
setupTempVarHelper("progress", ".hype");
setupTempVarHelper("goal", ".hype");
setupTempVarHelper("top_contributions", ".hype");
setupTempVarHelper("last_contribution", ".hype");
setupTempVarHelper("level", ".hype");
setupTempVarHelper("started_at", ".hype");
setupTempVarHelper("ended_at", ".hype");
setupTempVarHelper("cooldown_ends_at", ".hype");
break;
case Condition::CHARITY_CAMPAIGN_START_EVENT:
setupTempVarHelper("id", ".charity");
setupTempVarHelper("charity_name");
setupTempVarHelper("charity_description");
setupTempVarHelper("charity_logo");
setupTempVarHelper("current_amount", ".charity");
setupTempVarHelper("target_amount", ".charity");
setupTempVarHelper("started_at", ".charity");
break;
case Condition::CHARITY_CAMPAIGN_PROGRESS_EVENT:
setupTempVarHelper("id", ".charity");
setupTempVarHelper("charity_name");
setupTempVarHelper("charity_description");
setupTempVarHelper("charity_logo");
setupTempVarHelper("current_amount", ".charity");
setupTempVarHelper("target_amount", ".charity");
break;
case Condition::CHARITY_CAMPAIGN_DONATION_EVENT:
setupTempVarHelper("charity_name");
setupTempVarHelper("charity_description");
setupTempVarHelper("charity_logo");
setupTempVarHelper("id", ".charity");
setupTempVarHelper("user_id", ".charity");
setupTempVarHelper("user_login", ".charity");
setupTempVarHelper("user_name", ".charity");
setupTempVarHelper("amount", ".charity");
break;
case Condition::CHARITY_CAMPAIGN_END_EVENT:
setupTempVarHelper("id", ".charity");
setupTempVarHelper("charity_name");
setupTempVarHelper("charity_description");
setupTempVarHelper("charity_logo");
setupTempVarHelper("current_amount", ".charity");
setupTempVarHelper("target_amount", ".charity");
setupTempVarHelper("stopped_at", ".charity");
break;
case Condition::POINTS_REWARD_ADDITION_EVENT:
case Condition::POINTS_REWARD_UPDATE_EVENT:
case Condition::POINTS_REWARD_DELETION_EVENT:
setupTempVarHelper("id", ".reward");
setupTempVarHelper("is_enabled", ".reward");
setupTempVarHelper("is_paused", ".reward");
setupTempVarHelper("is_in_stock", ".reward");
setupTempVarHelper("title", ".reward");
setupTempVarHelper("cost", ".reward");
setupTempVarHelper("prompt", ".reward");
setupTempVarHelper("is_user_input_required", ".reward");
setupTempVarHelper("should_redemptions_skip_request_queue",
".reward");
setupTempVarHelper("max_per_stream", ".reward");
setupTempVarHelper("max_per_user_per_stream", ".reward");
setupTempVarHelper("background_color", ".reward");
setupTempVarHelper("image", ".reward");
setupTempVarHelper("default_image", ".reward");
setupTempVarHelper("global_cooldown", ".reward");
setupTempVarHelper("cooldown_expires_at", ".reward");
setupTempVarHelper("redemptions_redeemed_current_stream",
".reward");
break;
case Condition::POINTS_REWARD_REDEMPTION_EVENT:
case Condition::POINTS_REWARD_REDEMPTION_UPDATE_EVENT:
setupTempVarHelper("id", ".reward");
setupTempVarHelper("user_id", ".reward");
setupTempVarHelper("user_login", ".reward");
setupTempVarHelper("user_name", ".reward");
setupTempVarHelper("user_input", ".reward");
setupTempVarHelper("status", ".reward");
setupTempVarHelper("reward", ".reward");
setupTempVarHelper("redeemed_at", ".reward");
break;
case Condition::USER_BAN_EVENT:
setupTempVarHelper("user_id", ".ban");
setupTempVarHelper("user_login", ".ban");
setupTempVarHelper("user_name", ".ban");
setupTempVarHelper("moderator_user_id", ".ban");
setupTempVarHelper("moderator_user_login", ".ban");
setupTempVarHelper("moderator_user_name", ".ban");
setupTempVarHelper("reason", ".ban");
setupTempVarHelper("banned_at", ".ban");
setupTempVarHelper("ends_at", ".ban");
setupTempVarHelper("is_permanent", ".ban");
break;
case Condition::USER_UNBAN_EVENT:
setupTempVarHelper("user_id", ".unban");
setupTempVarHelper("user_login", ".unban");
setupTempVarHelper("user_name", ".unban");
setupTempVarHelper("moderator_user_id", ".unban");
setupTempVarHelper("moderator_user_login", ".unban");
setupTempVarHelper("moderator_user_name", ".unban");
break;
case Condition::USER_MODERATOR_ADDITION_EVENT:
setupTempVarHelper("user_id", ".addMod");
setupTempVarHelper("user_login", ".addMod");
setupTempVarHelper("user_name", ".addMod");
break;
case Condition::USER_MODERATOR_DELETION_EVENT:
setupTempVarHelper("user_id", ".removeMod");
setupTempVarHelper("user_login", ".removeMod");
setupTempVarHelper("user_name", ".removeMod");
break;
case Condition::CHANNEL_INFO_UPDATE_EVENT:
setupTempVarHelper("title");
setupTempVarHelper("language");
setupTempVarHelper("category_id");
setupTempVarHelper("category_name");
setupTempVarHelper("content_classification_labels");
break;
case Condition::SHOUTOUT_OUTBOUND_EVENT:
setupTempVarHelper("to_broadcaster_user_id", ".shoutout");
setupTempVarHelper("to_broadcaster_user_login", ".shoutout");
setupTempVarHelper("to_broadcaster_user_name", ".shoutout");
setupTempVarHelper("moderator_user_id", ".shoutout");
setupTempVarHelper("moderator_user_login", ".shoutout");
setupTempVarHelper("moderator_user_name", ".shoutout");
setupTempVarHelper("viewer_count", ".shoutout");
setupTempVarHelper("started_at", ".shoutout");
setupTempVarHelper("cooldown_ends_at", ".shoutout");
setupTempVarHelper("target_cooldown_ends_at", ".shoutout");
break;
case Condition::SHOUTOUT_INBOUND_EVENT:
setupTempVarHelper("from_broadcaster_user_id",
".shoutoutReceived");
setupTempVarHelper("from_broadcaster_user_login",
".shoutoutReceived");
setupTempVarHelper("from_broadcaster_user_name",
".shoutoutReceived");
setupTempVarHelper("viewer_count", ".shoutoutReceived");
setupTempVarHelper("started_at", ".shoutoutReceived");
break;
case Condition::SHIELD_MODE_START_EVENT:
case Condition::SHIELD_MODE_END_EVENT:
setupTempVarHelper("moderator_user_id", ".shieldMode");
setupTempVarHelper("moderator_user_login", ".shieldMode");
setupTempVarHelper("moderator_user_name", ".shieldMode");
setupTempVarHelper("started_at", ".shieldMode");
setupTempVarHelper("ended_at", ".shieldMode");
break;
case Condition::FOLLOW_EVENT:
setupTempVarHelper("user_id", ".follow");
setupTempVarHelper("user_login", ".follow");
setupTempVarHelper("user_name", ".follow");
setupTempVarHelper("followed_at");
break;
case Condition::RAID_OUTBOUND_EVENT:
case Condition::LIVE_POLLING:
setupTempVarHelper("id", ".stream.online");
setupTempVarHelper("game_id");
setupTempVarHelper("game_name");
setupTempVarHelper("title");
setupTempVarHelper("tags");
setupTempVarHelper("viewer_count", ".live");
setupTempVarHelper("started_at", ".stream.online");
setupTempVarHelper("language");
setupTempVarHelper("thumbnail_url");
setupTempVarHelper("is_mature");
break;
case Condition::TITLE_POLLING:
case Condition::CATEGORY_POLLING:
setupTempVarHelper("language");
setupTempVarHelper("game_id");
setupTempVarHelper("game_name");
setupTempVarHelper("title");
setupTempVarHelper("delay");
setupTempVarHelper("tags");
setupTempVarHelper("content_classification_labels");
setupTempVarHelper("is_branded_content");
break;
default:
break;
}
}
static inline void populateConditionSelection(QComboBox *list)
{
for (const auto &[condition, name] : conditionTypes) {
@ -747,6 +1175,8 @@ MacroConditionTwitchEdit::MacroConditionTwitchEdit(
QWidget::connect(_category,
SIGNAL(CategoreyChanged(const TwitchCategory &)), this,
SLOT(CategoreyChanged(const TwitchCategory &)));
QWidget::connect(this, SIGNAL(TempVarsChanged()), window(),
SIGNAL(SegmentTempVarsChanged()));
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.twitch.entry"),
_layout,
@ -794,6 +1224,7 @@ void MacroConditionTwitchEdit::ConditionChanged(int idx)
_entryData->SetCondition(static_cast<MacroConditionTwitch::Condition>(
_conditions->itemData(idx).toInt()));
SetupWidgetVisibility();
emit TempVarsChanged();
}
void MacroConditionTwitchEdit::TwitchTokenChanged(const QString &token)

View File

@ -109,6 +109,9 @@ private:
const char *version, bool includeModeratorId = false,
const char *mainUserIdFieldName = "broadcaster_user_id",
obs_data_t *extraConditions = nullptr);
void SetupTempVars();
void SetTempVarValues(const ChannelLiveInfo &);
void SetTempVarValues(const ChannelInfo &);
Condition _condition = Condition::LIVE_POLLING;
std::future<std::string> _subscriptionIDFuture;
@ -145,6 +148,7 @@ private slots:
signals:
void HeaderInfoChanged(const QString &);
void TempVarsChanged();
protected:
std::shared_ptr<MacroConditionTwitch> _entryData;