Interface MessageAttachableListenerManager

    • Method Detail

      • addReactionRemoveAllListener

        static ListenerManager<ReactionRemoveAllListener> addReactionRemoveAllListener​(DiscordApi api,
                                                                                       long messageId,
                                                                                       ReactionRemoveAllListener listener)
        Adds a ReactionRemoveAllListener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message which should be listened to.
        listener - The listener to add.
        Returns:
        The manager of the listener.
      • getReactionRemoveAllListeners

        static List<ReactionRemoveAllListener> getReactionRemoveAllListeners​(DiscordApi api,
                                                                             long messageId)
        Gets a list with all registered ReactionRemoveAllListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered ReactionRemoveAllListeners.
      • getReactionRemoveAllListeners

        static List<ReactionRemoveAllListener> getReactionRemoveAllListeners​(DiscordApi api,
                                                                             String messageId)
        Gets a list with all registered ReactionRemoveAllListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered ReactionRemoveAllListeners.
      • getReactionRemoveAllListeners

        List<ReactionRemoveAllListener> getReactionRemoveAllListeners​()
        Gets a list with all registered ReactionRemoveAllListeners.
        Returns:
        A list with all registered ReactionRemoveAllListeners.
      • addReactionAddListener

        static ListenerManager<ReactionAddListener> addReactionAddListener​(DiscordApi api,
                                                                           long messageId,
                                                                           ReactionAddListener listener)
        Adds a ReactionAddListener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message which should be listened to.
        listener - The listener to add.
        Returns:
        The manager of the listener.
      • getReactionAddListeners

        static List<ReactionAddListener> getReactionAddListeners​(DiscordApi api,
                                                                 long messageId)
        Gets a list with all registered ReactionAddListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered ReactionAddListeners.
      • getReactionAddListeners

        static List<ReactionAddListener> getReactionAddListeners​(DiscordApi api,
                                                                 String messageId)
        Gets a list with all registered ReactionAddListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered ReactionAddListeners.
      • getReactionAddListeners

        List<ReactionAddListener> getReactionAddListeners​()
        Gets a list with all registered ReactionAddListeners.
        Returns:
        A list with all registered ReactionAddListeners.
      • addReactionRemoveListener

        static ListenerManager<ReactionRemoveListener> addReactionRemoveListener​(DiscordApi api,
                                                                                 long messageId,
                                                                                 ReactionRemoveListener listener)
        Adds a ReactionRemoveListener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message which should be listened to.
        listener - The listener to add.
        Returns:
        The manager of the listener.
      • getReactionRemoveListeners

        static List<ReactionRemoveListener> getReactionRemoveListeners​(DiscordApi api,
                                                                       long messageId)
        Gets a list with all registered ReactionRemoveListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered ReactionRemoveListeners.
      • getReactionRemoveListeners

        static List<ReactionRemoveListener> getReactionRemoveListeners​(DiscordApi api,
                                                                       String messageId)
        Gets a list with all registered ReactionRemoveListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered ReactionRemoveListeners.
      • getReactionRemoveListeners

        List<ReactionRemoveListener> getReactionRemoveListeners​()
        Gets a list with all registered ReactionRemoveListeners.
        Returns:
        A list with all registered ReactionRemoveListeners.
      • addMessageEditListener

        static ListenerManager<MessageEditListener> addMessageEditListener​(DiscordApi api,
                                                                           long messageId,
                                                                           MessageEditListener listener)
        Adds a MessageEditListener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message which should be listened to.
        listener - The listener to add.
        Returns:
        The manager of the listener.
      • getMessageEditListeners

        static List<MessageEditListener> getMessageEditListeners​(DiscordApi api,
                                                                 long messageId)
        Gets a list with all registered MessageEditListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered MessageEditListeners.
      • getMessageEditListeners

        static List<MessageEditListener> getMessageEditListeners​(DiscordApi api,
                                                                 String messageId)
        Gets a list with all registered MessageEditListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered MessageEditListeners.
      • getMessageEditListeners

        List<MessageEditListener> getMessageEditListeners​()
        Gets a list with all registered MessageEditListeners.
        Returns:
        A list with all registered MessageEditListeners.
      • getCachedMessageUnpinListeners

        List<CachedMessageUnpinListener> getCachedMessageUnpinListeners​()
        Gets a list with all registered CachedMessageUnpinListeners.
        Returns:
        A list with all registered CachedMessageUnpinListeners.
      • addMessageDeleteListener

        static ListenerManager<MessageDeleteListener> addMessageDeleteListener​(DiscordApi api,
                                                                               long messageId,
                                                                               MessageDeleteListener listener)
        Adds a MessageDeleteListener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message which should be listened to.
        listener - The listener to add.
        Returns:
        The manager of the listener.
      • getMessageDeleteListeners

        static List<MessageDeleteListener> getMessageDeleteListeners​(DiscordApi api,
                                                                     long messageId)
        Gets a list with all registered MessageDeleteListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered MessageDeleteListeners.
      • getMessageDeleteListeners

        static List<MessageDeleteListener> getMessageDeleteListeners​(DiscordApi api,
                                                                     String messageId)
        Gets a list with all registered MessageDeleteListeners of a specific message.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A list with all registered MessageDeleteListeners.
      • getMessageDeleteListeners

        List<MessageDeleteListener> getMessageDeleteListeners​()
        Gets a list with all registered MessageDeleteListeners.
        Returns:
        A list with all registered MessageDeleteListeners.
      • getCachedMessagePinListeners

        List<CachedMessagePinListener> getCachedMessagePinListeners​()
        Gets a list with all registered CachedMessagePinListeners.
        Returns:
        A list with all registered CachedMessagePinListeners.
      • addMessageAttachableListener

        static <T extends MessageAttachableListener & ObjectAttachableListenerCollection<ListenerManager<T>> addMessageAttachableListener​(DiscordApi api,
                                                                                                                                            long messageId,
                                                                                                                                            T listener)
        Adds a listener that implements one or more MessageAttachableListeners to the message with the given id. Adding a listener multiple times will only add it once and return the same listener managers on each invocation. The order of invocation is according to first addition.
        Type Parameters:
        T - The type of the listener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message which should be listened to.
        listener - The listener to add.
        Returns:
        The managers for the added listener.
      • addMessageAttachableListener

        static <T extends MessageAttachableListener & ObjectAttachableListenerCollection<ListenerManager<T>> addMessageAttachableListener​(DiscordApi api,
                                                                                                                                            String messageId,
                                                                                                                                            T listener)
        Adds a listener that implements one or more MessageAttachableListeners to the message with the given id. Adding a listener multiple times will only add it once and return the same listener managers on each invocation. The order of invocation is according to first addition.
        Type Parameters:
        T - The type of the listener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message which should be listened to.
        listener - The listener to add.
        Returns:
        The managers for the added listener.
      • removeMessageAttachableListener

        static <T extends MessageAttachableListener & ObjectAttachableListener> void removeMessageAttachableListener​(DiscordApi api,
                                                                                                                     long messageId,
                                                                                                                     T listener)
        Removes a listener that implements one or more MessageAttachableListeners from the message with the given id.
        Type Parameters:
        T - The type of the listener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        listener - The listener to remove.
      • removeMessageAttachableListener

        static <T extends MessageAttachableListener & ObjectAttachableListener> void removeMessageAttachableListener​(DiscordApi api,
                                                                                                                     String messageId,
                                                                                                                     T listener)
        Removes a listener that implements one or more MessageAttachableListeners from the message with the given id.
        Type Parameters:
        T - The type of the listener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        listener - The listener to remove.
      • getMessageAttachableListeners

        static <T extends MessageAttachableListener & ObjectAttachableListenerMap<T,List<Class<T>>> getMessageAttachableListeners​(DiscordApi api,
                                                                                                                                    long messageId)
        Gets a map with all registered listeners that implement one or more MessageAttachableListeners and their assigned listener classes they listen to for the message with the given id.
        Type Parameters:
        T - The type of the listeners.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A map with all registered listeners that implement one or more MessageAttachableListeners and their assigned listener classes they listen to.
      • getMessageAttachableListeners

        static <T extends MessageAttachableListener & ObjectAttachableListenerMap<T,List<Class<T>>> getMessageAttachableListeners​(DiscordApi api,
                                                                                                                                    String messageId)
        Gets a map with all registered listeners that implement one or more MessageAttachableListeners and their assigned listener classes they listen to for the message with the given id.
        Type Parameters:
        T - The type of the listeners.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        Returns:
        A map with all registered listeners that implement one or more MessageAttachableListeners and their assigned listener classes they listen to.
      • removeListener

        static <T extends MessageAttachableListener & ObjectAttachableListener> void removeListener​(DiscordApi api,
                                                                                                    long messageId,
                                                                                                    Class<T> listenerClass,
                                                                                                    T listener)
        Removes a MessageAttachableListener from the message with the given id.
        Type Parameters:
        T - The type of the listener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        listenerClass - The listener class.
        listener - The listener to remove.
      • removeListener

        static <T extends MessageAttachableListener & ObjectAttachableListener> void removeListener​(DiscordApi api,
                                                                                                    String messageId,
                                                                                                    Class<T> listenerClass,
                                                                                                    T listener)
        Removes a MessageAttachableListener from the message with the given id.
        Type Parameters:
        T - The type of the listener.
        Parameters:
        api - The discord api instance.
        messageId - The id of the message.
        listenerClass - The listener class.
        listener - The listener to remove.
      • addMessageAttachableListener

        <T extends MessageAttachableListener & ObjectAttachableListenerCollection<ListenerManager<T>> addMessageAttachableListener​(T listener)
        Adds a listener that implements one or more MessageAttachableListeners. Adding a listener multiple times will only add it once and return the same listener managers on each invocation. The order of invocation is according to first addition.
        Type Parameters:
        T - The type of the listener.
        Parameters:
        listener - The listener to add.
        Returns:
        The managers for the added listener.
      • removeMessageAttachableListener

        <T extends MessageAttachableListener & ObjectAttachableListener> void removeMessageAttachableListener​(T listener)
        Removes a listener that implements one or more MessageAttachableListeners.
        Type Parameters:
        T - The type of the listener.
        Parameters:
        listener - The listener to remove.
      • getMessageAttachableListeners

        <T extends MessageAttachableListener & ObjectAttachableListenerMap<T,List<Class<T>>> getMessageAttachableListeners​()
        Gets a map with all registered listeners that implement one or more MessageAttachableListeners and their assigned listener classes they listen to.
        Type Parameters:
        T - The type of the listeners.
        Returns:
        A map with all registered listeners that implement one or more MessageAttachableListeners and their assigned listener classes they listen to.
      • removeListener

        <T extends MessageAttachableListener & ObjectAttachableListener> void removeListener​(Class<T> listenerClass,
                                                                                             T listener)
        Removes a listener from this object.
        Type Parameters:
        T - The type of the listener.
        Parameters:
        listenerClass - The listener class.
        listener - The listener to remove.