Interface PrefixProvider<M>

  • Type Parameters:
    M - the class of the messages for which this provider can provide prefixes
    All Known Implementing Classes:
    MentionPrefixProviderJavacord

    public interface PrefixProvider<M>
    A provider of command prefixes based on messages. To provide one, create an implementation of this interface and make it a discoverable CDI bean, for example by annotating it with @ApplicationScoped.

    If no custom prefix provider is found, a default one is used, that always returns "!" as the prefix.

    • Method Detail

      • getCommandPrefix

        String getCommandPrefix​(M message)
        Returns the command prefix to be used for the given message. Typically this does not depend on the message content itself, but on properties of the message, like the server the message was sent on, to have different prefixes on different servers.
        Parameters:
        message - the message for which the prefix has to be returned
        Returns:
        the command prefix to use for the given message