Package discord4j.core.spec.legacy
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 createGuildEmojiobjects. Emojis and animated emojis have a maximum file size of 256kb.- See Also:
- Create Guild Emoji
-
-
Constructor Summary
Constructors Constructor Description LegacyGuildEmojiCreateSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LegacyGuildEmojiCreateSpecaddRole(Snowflake roleId)Adds a role for which the createdGuildEmojiwill be whitelisted.discord4j.discordjson.json.GuildEmojiCreateRequestasRequest()StringgetReason()Returns the current audit log reason set on the spec.LegacyGuildEmojiCreateSpecsetImage(Image image)Sets the image for the createdGuildEmoji.LegacyGuildEmojiCreateSpecsetName(String name)Sets the name for the createdGuildEmoji.LegacyGuildEmojiCreateSpecsetReason(String reason)Sets the reason to show in the audit logs when the spec is built.
-
-
-
Method Detail
-
setName
public LegacyGuildEmojiCreateSpec setName(String name)
Sets the name for the createdGuildEmoji.- Parameters:
name- The name for the emoji.- Returns:
- This spec.
-
setImage
public LegacyGuildEmojiCreateSpec setImage(Image image)
Sets the image for the createdGuildEmoji.- Parameters:
image- The image used for the emoji.- Returns:
- This spec.
-
addRole
public LegacyGuildEmojiCreateSpec addRole(Snowflake roleId)
Adds a role for which the createdGuildEmojiwill be whitelisted.- Parameters:
roleId- The role identifier.- Returns:
- This spec.
-
setReason
public LegacyGuildEmojiCreateSpec setReason(@Nullable String reason)
Description copied from interface:LegacyAuditSpecSets the reason to show in the audit logs when the spec is built.- Specified by:
setReasonin interfaceLegacyAuditSpec<discord4j.discordjson.json.GuildEmojiCreateRequest>- Parameters:
reason- The audit log reason.- Returns:
- This spec.
-
getReason
@Nullable public String getReason()
Description copied from interface:LegacyAuditSpecReturns the current audit log reason set on the spec.- Specified by:
getReasonin interfaceLegacyAuditSpec<discord4j.discordjson.json.GuildEmojiCreateRequest>- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.GuildEmojiCreateRequest asRequest()
- Specified by:
asRequestin interfaceLegacySpec<discord4j.discordjson.json.GuildEmojiCreateRequest>
-
-