Class LegacyGuildEmojiCreateSpec

java.lang.Object
discord4j.core.spec.legacy.LegacyGuildEmojiCreateSpec
All Implemented Interfaces:
LegacyAuditSpec<discord4j.discordjson.json.GuildEmojiCreateRequest>, LegacySpec<discord4j.discordjson.json.GuildEmojiCreateRequest>

public class LegacyGuildEmojiCreateSpec extends Object implements LegacyAuditSpec<discord4j.discordjson.json.GuildEmojiCreateRequest>
LegacySpec used to create GuildEmoji objects. Emojis and animated emojis have a maximum file size of 256kb.
See Also:
  • Constructor Details

    • LegacyGuildEmojiCreateSpec

      public LegacyGuildEmojiCreateSpec()
  • Method Details

    • setName

      public LegacyGuildEmojiCreateSpec setName(String name)
      Sets the name for the created GuildEmoji.
      Parameters:
      name - The name for the emoji.
      Returns:
      This spec.
    • setImage

      public LegacyGuildEmojiCreateSpec setImage(Image image)
      Sets the image for the created GuildEmoji.
      Parameters:
      image - The image used for the emoji.
      Returns:
      This spec.
    • addRole

      public LegacyGuildEmojiCreateSpec addRole(Snowflake roleId)
      Adds a role for which the created GuildEmoji will be whitelisted.
      Parameters:
      roleId - The role identifier.
      Returns:
      This spec.
    • setReason

      public LegacyGuildEmojiCreateSpec setReason(@Nullable String reason)
      Description copied from interface: LegacyAuditSpec
      Sets the reason to show in the audit logs when the spec is built.
      Specified by:
      setReason in interface LegacyAuditSpec<discord4j.discordjson.json.GuildEmojiCreateRequest>
      Parameters:
      reason - The audit log reason.
      Returns:
      This spec.
    • getReason

      @Nullable public String getReason()
      Description copied from interface: LegacyAuditSpec
      Returns the current audit log reason set on the spec.
      Specified by:
      getReason in interface LegacyAuditSpec<discord4j.discordjson.json.GuildEmojiCreateRequest>
      Returns:
      The current audit log reason.
    • asRequest

      public discord4j.discordjson.json.GuildEmojiCreateRequest asRequest()
      Specified by:
      asRequest in interface LegacySpec<discord4j.discordjson.json.GuildEmojiCreateRequest>