Class MentionPrefixProviderJavacord

  • All Implemented Interfaces:
    PrefixProvider<Message>

    public abstract class MentionPrefixProviderJavacord
    extends Object
    implements PrefixProvider<Message>
    A base class for having a mention of the Javacord-based bot as command prefix. To use it, create a trivial subclass of this class and make it a discoverable CDI bean, for example by annotating it with @ApplicationScoped.
    • Constructor Detail

      • MentionPrefixProviderJavacord

        public MentionPrefixProviderJavacord()
        Constructs a new mention prefix provider for Javacord.
    • Method Detail

      • getCommandPrefix

        public String getCommandPrefix​(Message message)
        Description copied from interface: PrefixProvider
        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.
        Specified by:
        getCommandPrefix in interface PrefixProvider<Message>
        Parameters:
        message - the message for which the prefix has to be returned
        Returns:
        the command prefix to use for the given message