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

fix(charity): resolve twitch doc issues #631

Merged
merged 1 commit into from Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,6 @@
package com.github.twitch4j.eventsub.events;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.twitch4j.common.util.DonationAmount;
import lombok.AccessLevel;
Expand All @@ -25,6 +26,7 @@ public class ChannelCharityDonateEvent extends EventSubUserChannelEvent {
/**
* An object that contains the amount of the user’s donation.
*/
@JsonAlias("target_amount") // https://github.com/twitchdev/issues/issues/642
private DonationAmount amount;

}
Expand Up @@ -14,7 +14,7 @@
* @see com.github.twitch4j.auth.domain.TwitchScopes#HELIX_CHANNEL_CHARITY_READ
*/
@Unofficial
public class ChannelCharityDonateType implements SubscriptionType<ChannelCharityCampaignCondition, ChannelCharityCampaignCondition.ChannelCharityCampaignConditionBuilder<?, ?>, ChannelCharityDonateEvent> {
public class BetaChannelCharityDonateType implements SubscriptionType<ChannelCharityCampaignCondition, ChannelCharityCampaignCondition.ChannelCharityCampaignConditionBuilder<?, ?>, ChannelCharityDonateEvent> {

@Override
public String getName() {
Expand All @@ -23,7 +23,7 @@ public String getName() {

@Override
public String getVersion() {
return "1";
return "beta";
}

@Override
Expand Down
Expand Up @@ -14,7 +14,7 @@ public class SubscriptionTypes {
private final Map<String, SubscriptionType<?, ?, ?>> SUBSCRIPTION_TYPES;

public final ChannelBanType CHANNEL_BAN;
@Unofficial public final ChannelCharityDonateType CHANNEL_CHARITY_DONATE;
@Unofficial public final BetaChannelCharityDonateType BETA_CHANNEL_CHARITY_DONATE;
public final ChannelCheerType CHANNEL_CHEER;
public final ChannelFollowType CHANNEL_FOLLOW;
public final ChannelGoalBeginType CHANNEL_GOAL_BEGIN;
Expand Down Expand Up @@ -60,7 +60,7 @@ public class SubscriptionTypes {
SUBSCRIPTION_TYPES = Collections.unmodifiableMap(
Stream.of(
CHANNEL_BAN = new ChannelBanType(),
CHANNEL_CHARITY_DONATE = new ChannelCharityDonateType(),
BETA_CHANNEL_CHARITY_DONATE = new BetaChannelCharityDonateType(),
CHANNEL_CHEER = new ChannelCheerType(),
CHANNEL_FOLLOW = new ChannelFollowType(),
CHANNEL_GOAL_BEGIN = new ChannelGoalBeginType(),
Expand Down
Expand Up @@ -330,7 +330,7 @@ HystrixCommand<CustomRewardRedemptionList> updateRedemptionStatus(
* <p>
* The ID in the broadcaster_id query parameter must match the user ID in the access token.
* <p>
* To receive events as donations occur, use {@link com.github.twitch4j.eventsub.subscriptions.SubscriptionTypes#CHANNEL_CHARITY_DONATE}.
* To receive events as donations occur, use {@link com.github.twitch4j.eventsub.subscriptions.SubscriptionTypes#BETA_CHANNEL_CHARITY_DONATE}.
*
* @param authToken Broadcaster user access token with the channel:read:charity scope.
* @param broadcasterId The ID of the broadcaster that’s actively running a charity campaign.
Expand Down