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

com.github.twitch4j.internal.ChatCommandHandler Maven / Gradle / Ivy

package com.github.twitch4j.internal;

import java.util.function.Consumer;

/**
 * A handler of a specific command type; consumes arguments from the chat message.
 */
@FunctionalInterface // simply just need to implement #accept(CommandArguments)
interface ChatCommandHandler extends Consumer {

    /**
     * @return the type of key that should be used for the rate limit bucket associated with this command.
     */
    default ChatCommandRateLimitType getLimitKey() {
        // most commands should be rate limited based on which channel they were executed in
        return ChatCommandRateLimitType.CHANNEL;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy