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 createGuildEmoji
objects. 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 LegacyGuildEmojiCreateSpec
addRole(Snowflake roleId)
Adds a role for which the createdGuildEmoji
will be whitelisted.discord4j.discordjson.json.GuildEmojiCreateRequest
asRequest()
String
getReason()
Returns the current audit log reason set on the spec.LegacyGuildEmojiCreateSpec
setImage(Image image)
Sets the image for the createdGuildEmoji
.LegacyGuildEmojiCreateSpec
setName(String name)
Sets the name for the createdGuildEmoji
.LegacyGuildEmojiCreateSpec
setReason(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 createdGuildEmoji
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 interfaceLegacyAuditSpec<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 interfaceLegacyAuditSpec<discord4j.discordjson.json.GuildEmojiCreateRequest>
- Returns:
- The current audit log reason.
-
asRequest
public discord4j.discordjson.json.GuildEmojiCreateRequest asRequest()
- Specified by:
asRequest
in interfaceLegacySpec<discord4j.discordjson.json.GuildEmojiCreateRequest>
-
-