Skip to content

Commit

Permalink
fix(charity): resolve twitch doc issues (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
iProdigy committed Aug 31, 2022
1 parent d7e88dc commit 6a90523
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
@@ -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

0 comments on commit 6a90523

Please sign in to comment.