Class AllowedMentions

java.lang.Object
discord4j.rest.util.AllowedMentions

public class AllowedMentions extends Object
A class for holding the allowed_mentions object with an built-in factory for default values. Also this class wraps the AllowedMentionsData JSON to a Discord4J class.
See Also:
  • Method Details

    • builder

      public static AllowedMentions.Builder builder()
      Create a builder for this AllowedMentions class. Building this object without any configuration is equivalent to suppressing all mentions.
      Returns:
      A builder class for allowed mentions
    • builder

      public static AllowedMentions.Builder builder(AllowedMentions template)
      Copy an existing AllowedMentions object to a new builder.
      Parameters:
      template - the allowed mentions object to copy
      Returns:
      A builder class for allowed mentions
    • suppressAll

      public static AllowedMentions suppressAll()
      Create an AllowedMentions object that will suppress all mentions.
      Returns:
      A suppressing allowed mentions
    • suppressEveryone

      public static AllowedMentions suppressEveryone()
      Create an AllowedMentions object that will suppress @everyone and @here mentions.
      Returns:
      A suppressing allowed mentions
    • mutate

      public AllowedMentions.Builder mutate()
      Copy this AllowedMentions object to a new builder.
      Returns:
      A builder class for allowed mentions
    • toData

      public discord4j.discordjson.json.AllowedMentionsData toData()
      Map this AllowedMentions object to a AllowedMentionsData JSON
      Returns:
      JSON object
    • from

      public static AllowedMentions from(discord4j.discordjson.json.AllowedMentionsData allowedMentionsData)
      Maps an AllowedMentionsData to a wrapped AllowedMentions object
      Parameters:
      allowedMentionsData - The data to map
      Returns:
      A wrapped AllowedMentionsData