com.github.twitch4j.helix.webhooks.topics.HypeTrainTopic Maven / Gradle / Ivy
package com.github.twitch4j.helix.webhooks.topics;
import com.github.twitch4j.helix.domain.HypeTrainEventList;
import lombok.Getter;
import lombok.NonNull;
import java.util.SortedMap;
import java.util.TreeMap;
/**
* Notifies upon active hype train events
*/
public class HypeTrainTopic extends TwitchWebhookTopic {
public static final String PATH = "/hypetrain/events";
/**
* User ID of the broadcaster
*/
@Getter
private final String broadcasterId;
/**
* Notifies upon active hype train events
*
* @param broadcasterId User ID of the broadcaster
* @deprecated Will be decommissioned after 2021-09-16 in favor of EventSub
*/
@Deprecated
public HypeTrainTopic(@NonNull String broadcasterId) {
super(PATH, HypeTrainEventList.class, mapParameters(broadcasterId));
this.broadcasterId = broadcasterId;
}
private static SortedMap mapParameters(String broadcasterId) {
SortedMap parameterMap = new TreeMap<>();
parameterMap.put("first", 1);
parameterMap.put("broadcaster_id", broadcasterId);
return parameterMap;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy