Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: notate power-up automatic reward redemptions #5471

Merged
merged 6 commits into from
Jun 22, 2024

Conversation

iProdigy
Copy link
Contributor

@iProdigy iProdigy commented Jun 18, 2024

  • indicate when bits celebrations have been redeemed
  • annotate messages as bits power-up redemptions (message effects or gigantify an emote)

Screenshot_20240618_014931

image
on hover:
image

currently no animation or gigantification is implemented (as they can be annoying)

https://blog.twitch.tv/en/2024/06/12/introducing-power-ups-unleash-special-effects-with-bits/

@@ -14,6 +14,39 @@ ChannelPointReward::ChannelPointReward(const QJsonObject &redemption)
this->title = reward.value("title").toString();
this->cost = reward.value("cost").toInt();
this->isUserInputRequired = reward.value("is_user_input_required").toBool();
this->isBits = reward.value("pricing_type").toString() == "BITS";

// accommodate idiosyncrasies of automatic reward redemptions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sample pubsub messages
{"type":"MESSAGE","data":{"topic":"community-points-channel-v1.11148817","message":"{\"type\":\"automatic-reward-redeemed\",\"data\":{\"timestamp\":\"2024-06-18T08:48:30.369543084Z\",\"redemption\":{\"id\":\"06f3ae08-d8b9-4e65-a3b7-28061c1e9bc5\",\"user\":{\"id\":\"11148817\",\"login\":\"pajlada\",\"display_name\":\"pajlada\"},\"channel_id\":\"11148817\",\"redeemed_at\":\"2024-06-18T08:48:30Z\",\"reward\":{\"channel_id\":\"11148817\",\"reward_type\":\"SEND_ANIMATED_MESSAGE\",\"cost\":0,\"default_cost\":0,\"min_cost\":0,\"image\":null,\"default_image\":{\"url_1x\":\"https://static-cdn.jtvnw.net/automatic-reward-images/comments-1.png\",\"url_2x\":\"https://static-cdn.jtvnw.net/automatic-reward-images/comments-2.png\",\"url_4x\":\"https://static-cdn.jtvnw.net/automatic-reward-images/comments-4.png\"},\"background_color\":null,\"default_background_color\":\"#F177C1\",\"is_enabled\":true,\"is_hidden_for_subs\":false,\"updated_for_indicator_at\":null,\"globally_updated_for_indicator_at\":\"2024-04-02T21:00:00Z\",\"is_in_stock\":true,\"max_per_stream\":{\"is_enabled\":false,\"max_per_stream\":0},\"max_per_user_per_stream\":{\"is_enabled\":false,\"max_per_user_per_stream\":0},\"global_cooldown\":{\"is_enabled\":false,\"global_cooldown_seconds\":0},\"cooldown_expires_at\":null,\"redemptions_redeemed_current_stream\":null,\"default_bits_cost\":60,\"bits_cost\":0,\"pricing_type\":\"BITS\"},\"redemption_metadata\":{\"send_animated_message_metadata\":{\"animation_id\":\"simmer\"}}}}}"}}
{"type":"MESSAGE","data":{"topic":"community-points-channel-v1.11148817","message":"{\"type\":\"automatic-reward-redeemed\",\"data\":{\"timestamp\":\"2024-06-18T08:48:34.700580425Z\",\"redemption\":{\"id\":\"59697f15-b669-4cb2-b3e9-358fe558d2c9\",\"user\":{\"id\":\"11148817\",\"login\":\"pajlada\",\"display_name\":\"pajlada\"},\"channel_id\":\"11148817\",\"redeemed_at\":\"2024-06-18T08:48:34Z\",\"reward\":{\"channel_id\":\"11148817\",\"reward_type\":\"SEND_ANIMATED_MESSAGE\",\"cost\":0,\"default_cost\":0,\"min_cost\":0,\"image\":null,\"default_image\":{\"url_1x\":\"https://static-cdn.jtvnw.net/automatic-reward-images/comments-1.png\",\"url_2x\":\"https://static-cdn.jtvnw.net/automatic-reward-images/comments-2.png\",\"url_4x\":\"https://static-cdn.jtvnw.net/automatic-reward-images/comments-4.png\"},\"background_color\":null,\"default_background_color\":\"#F177C1\",\"is_enabled\":true,\"is_hidden_for_subs\":false,\"updated_for_indicator_at\":null,\"globally_updated_for_indicator_at\":\"2024-04-02T21:00:00Z\",\"is_in_stock\":true,\"max_per_stream\":{\"is_enabled\":false,\"max_per_stream\":0},\"max_per_user_per_stream\":{\"is_enabled\":false,\"max_per_user_per_stream\":0},\"global_cooldown\":{\"is_enabled\":false,\"global_cooldown_seconds\":0},\"cooldown_expires_at\":null,\"redemptions_redeemed_current_stream\":null,\"default_bits_cost\":60,\"bits_cost\":0,\"pricing_type\":\"BITS\"},\"redemption_metadata\":{\"send_animated_message_metadata\":{\"animation_id\":\"rainbow-eclipse\"}}}}}"}}
{"type":"MESSAGE","data":{"topic":"community-points-channel-v1.11148817","message":"{\"type\":\"automatic-reward-redeemed\",\"data\":{\"timestamp\":\"2024-06-18T08:48:44.945205709Z\",\"redemption\":{\"id\":\"45c89a4a-6290-4e43-91dc-01ea1bfc5982\",\"user\":{\"id\":\"11148817\",\"login\":\"pajlada\",\"display_name\":\"pajlada\"},\"channel_id\":\"11148817\",\"redeemed_at\":\"2024-06-18T08:48:44Z\",\"reward\":{\"channel_id\":\"11148817\",\"reward_type\":\"SEND_GIGANTIFIED_EMOTE\",\"cost\":0,\"default_cost\":0,\"min_cost\":0,\"image\":null,\"default_image\":{\"url_1x\":\"https://static-cdn.jtvnw.net/automatic-reward-images/emote_add-1.png\",\"url_2x\":\"https://static-cdn.jtvnw.net/automatic-reward-images/emote_add-2.png\",\"url_4x\":\"https://static-cdn.jtvnw.net/automatic-reward-images/emote_add-4.png\"},\"background_color\":null,\"default_background_color\":\"#69B6FF\",\"is_enabled\":true,\"is_hidden_for_subs\":false,\"updated_for_indicator_at\":null,\"globally_updated_for_indicator_at\":\"2024-04-02T21:00:00Z\",\"is_in_stock\":true,\"max_per_stream\":{\"is_enabled\":false,\"max_per_stream\":0},\"max_per_user_per_stream\":{\"is_enabled\":false,\"max_per_user_per_stream\":0},\"global_cooldown\":{\"is_enabled\":false,\"global_cooldown_seconds\":0},\"cooldown_expires_at\":null,\"redemptions_redeemed_current_stream\":null,\"default_bits_cost\":100,\"bits_cost\":0,\"pricing_type\":\"BITS\"},\"redemption_metadata\":{\"send_gigantified_emote_metadata\":{\"emote\":{\"id\":\"116051\",\"token\":\"forsen1\"}}}}}}"}}

notably, reward id/title/is_user_input_required are all missing in the raw payload

@iProdigy
Copy link
Contributor Author

do we want any of these strings assigned to constants

SEND_ANIMATED_MESSAGE
SEND_GIGANTIFIED_EMOTE
CELEBRATION
animated-message
gigantified-emote-message

@pajlada pajlada enabled auto-merge (squash) June 22, 2024 10:38
@pajlada pajlada merged commit 2ef3306 into Chatterino:master Jun 22, 2024
17 checks passed
@iProdigy iProdigy deleted the feature/powerups branch June 22, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants