All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.twitch4j.helix.domain.AutomodEnforceCheck Maven / Gradle / Ivy

package com.github.twitch4j.helix.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Value;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.UUID;

@Value
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AutomodEnforceCheck {
    /**
     * Developer-generated identifier for mapping messages to results.
     */
    @NotNull
    String msgId;

    /**
     * Message text.
     */
    @NotNull
    String msgText;

    /**
     * User ID of the sender.
     *
     * @see Deprecation announcement
     * @deprecated The AutoMod service will no longer take into account the status of a user to determine whether a string message meets the channel’s AutoMod requirements on June 20, 2022
     */
    @Deprecated
    @Nullable
    String userId;

    /**
     * Constructs a message object to be checked against AutoMod enforcement settings
     *
     * @param message  The message to be checked
     * @param senderId The channel in which the message should be checked
     * @see com.github.twitch4j.helix.TwitchHelix#checkAutomodStatus(String, String, AutomodEnforceCheckList)
     * @deprecated senderId is deprecated by Twitch
     */
    @Deprecated
    public AutomodEnforceCheck(@NotNull String message, @Nullable String senderId) {
        this.msgId = UUID.randomUUID().toString();
        this.msgText = message;
        this.userId = senderId;
    }

    /**
     * Constructs a message object to be checked against AutoMod enforcement settings
     *
     * @param message The message to be checked
     * @see com.github.twitch4j.helix.TwitchHelix#checkAutomodStatus(String, String, AutomodEnforceCheckList)
     */
    public AutomodEnforceCheck(@NotNull String message) {
        this.msgId = UUID.randomUUID().toString();
        this.msgText = message;
        this.userId = null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy