Skip to content

Commit

Permalink
Fix subscription testing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
GospelBG committed Mar 1, 2025
1 parent e84b940 commit acf6fb1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions core/src/main/java/me/gosdev/chatpointsttv/Tests/EventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.github.twitch4j.pubsub.domain.ChannelPointsUser;
import com.github.twitch4j.pubsub.events.RewardRedeemedEvent;

import me.gosdev.chatpointsttv.ChatPointsTTV;
import me.gosdev.chatpointsttv.Utils.TwitchUtils;

public class EventTest {
Expand Down Expand Up @@ -69,18 +70,20 @@ public static ChannelChatMessageEvent CheerEvent(String channel, String chatter,

public static ChannelChatNotificationEvent SubEvent(String channel, String chatter, SubscriptionPlan plan, int months) {
ChannelChatNotificationEvent event = jsonToObject(
"{\"user_id\":\"" + TwitchUtils.getUserId(chatter) +
"\",\"user_login\":\"" + chatter.toLowerCase() +
"\",\"user_name\":\"" + chatter +
"{\"chatter_user_id\":\"" + TwitchUtils.getUserId(chatter) +
"\",\"chatter_user_login\":\"" + chatter.toLowerCase() +
"\",\"chatter_user_name\":\"" + chatter +
"\",\"broadcaster_user_id\":\"" + TwitchUtils.getUserId(channel) +
"\",\"broadcaster_user_login\":\"" + channel.toLowerCase() +
"\",\"broadcaster_user_name\":\"" + channel +
"\",\"notice_type\": \"sub" +
"\",\"sub\":{\"sub_tier\":\"" + plan.name() +
"\",\"sub\":{\"sub_tier\":\"" + (plan.equals(SubscriptionPlan.TWITCH_PRIME) ? "1000" : plan.toString()) +
"\",\"is_prime\":" + (plan.equals(SubscriptionPlan.TWITCH_PRIME) ? "true" : "false") +
",\"duration_months\":" + months + "}}",
ChannelChatNotificationEvent.class);

ChatPointsTTV.getPlugin().log.info(plan.toString());

return event;
}

Expand Down

0 comments on commit acf6fb1

Please sign in to comment.