Class MentionUtil

java.lang.Object
discord4j.core.util.MentionUtil

public final class MentionUtil extends Object
  • Field Details

  • Method Details

    • forChannel

      public static String forChannel(Snowflake id)
      Gets a raw mention for a Channel.

      This is the format utilized to directly mention another channel.

      Parameters:
      id - The id of the channel to mention.
      Returns:
      The raw mention.
    • forRole

      public static String forRole(Snowflake id)
      Gets a raw mention for a Role.

      The use of this mention requires being permitted by the "allowed mentions" of any messages being sent.

      This is the format utilized to directly mention another role (assuming the role exists in context of the mention).

      Parameters:
      id - The id of the role to mention.
      Returns:
      The raw mention.
    • forUser

      public static String forUser(Snowflake id)
      Gets a raw mention for a User.

      The use of this mention requires being permitted by the "allowed mentions" of any messages being sent.

      This is the format utilized to directly mention another user (assuming the user exists in context of the mention).

      Parameters:
      id - The id of the user to mention.
      Returns:
      The raw mention.