Class SpoilerElement

    • Constructor Detail

      • SpoilerElement

        public SpoilerElement​(String language,
                              String hint)
        Create a new SpoilerElement with a hint about a content and a language attribute.
        Parameters:
        language - language of the hint.
        hint - hint about the content.
    • Method Detail

      • getHint

        public String getHint()
        Return the hint text of the spoiler. May be null.
        Returns:
        hint text
      • addSpoiler

        public static void addSpoiler​(Message message)
        Add a SpoilerElement to a message.
        Parameters:
        message - message to add the Spoiler to.
      • addSpoiler

        public static void addSpoiler​(Message message,
                                      String hint)
        Add a SpoilerElement with a hint to a message.
        Parameters:
        message - Message to add the Spoiler to.
        hint - Hint about the Spoilers content.
      • addSpoiler

        public static void addSpoiler​(Message message,
                                      String lang,
                                      String hint)
        Add a SpoilerElement with a hint in a certain language to a message.
        Parameters:
        message - Message to add the Spoiler to.
        lang - language of the Spoiler hint.
        hint - hint.
      • containsSpoiler

        public static boolean containsSpoiler​(Message message)
        Returns true, if the message has at least one spoiler element.
        Parameters:
        message - message
        Returns:
        true if message has spoiler extension
      • getSpoilers

        public static Map<String,​StringgetSpoilers​(Message message)
        Return a map of all spoilers contained in a message. The map uses the language of a spoiler as key. If a spoiler has no language attribute, its key will be an empty String.
        Parameters:
        message - message
        Returns:
        map of spoilers