Package discord4j.core.spec
Class GuildEditSpec
- java.lang.Object
-
- discord4j.core.spec.GuildEditSpec
-
- All Implemented Interfaces:
AuditSpec<discord4j.discordjson.json.GuildModifyRequest>
,Spec<discord4j.discordjson.json.GuildModifyRequest>
public class GuildEditSpec extends Object implements AuditSpec<discord4j.discordjson.json.GuildModifyRequest>
A spec used to selectively modify properties from aGuild
.- See Also:
- Modify Guild
-
-
Constructor Summary
Constructors Constructor Description GuildEditSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description discord4j.discordjson.json.GuildModifyRequest
asRequest()
String
getReason()
Returns the current audit log reason set on the spec.GuildEditSpec
setAfkChannelId(Snowflake afkChannelId)
GuildEditSpec
setAfkTimeout(int afkTimeout)
Sets the AFK timeout, in seconds, for thisGuild
.GuildEditSpec
setBanner(Image banner)
Sets the image for the guild banner (when the server has the BANNER feature).GuildEditSpec
setDefaultMessageNotificationsLevel(Guild.NotificationLevel notificationsLevel)
Sets the default message notification level for the modifiedGuild
.GuildEditSpec
setDescription(String description)
Sets the description for the guild, if the guild is discoverable.GuildEditSpec
setDiscoverySplash(Image discoverySplash)
Sets the image for the guild discovery splash (when the server has the DISCOVERABLE feature).GuildEditSpec
setExplicitContentFilter(Guild.ContentFilterLevel level)
Sets the explicit content filter level for the modifiedGuild
.GuildEditSpec
setFeatures(Set<String> features)
Sets the enabled guild features.GuildEditSpec
setIcon(Image icon)
Sets the image icon to display for the modifiedGuild
.GuildEditSpec
setName(String name)
Sets the modifiedGuild
name.GuildEditSpec
setOwnerId(Snowflake ownerId)
Sets the new owner ID for thisGuild
.GuildEditSpec
setPreferredLocale(Locale preferredLocale)
Sets the preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US".GuildEditSpec
setPublicUpdatesChannelId(Snowflake publicUpdatesChannelId)
Sets the id of the channel where admins and moderators of Community guilds receive notices from Discord.GuildEditSpec
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.GuildEditSpec
setRegion(Region.Id regionId)
Sets the voice region for the modifiedGuild
.GuildEditSpec
setRegion(String regionId)
Sets the voice region for the modifiedGuild
, automatic if null.GuildEditSpec
setRulesChannelId(Snowflake rulesChannelId)
Sets the id of the channel where Community guilds display rules and/or guidelines.GuildEditSpec
setSplash(Image splash)
Sets the image for the guild splash (when the server has the INVITE_SPLASH feature).GuildEditSpec
setSystemChannelFlags(Guild.SystemChannelFlag flag)
Deprecated.GuildEditSpec
setSystemChannelFlags(Guild.SystemChannelFlag... flags)
Sets the system channel flags.GuildEditSpec
setSystemChannelId(Snowflake systemChannelId)
Sets the id of the channel where guild notices such as welcome messages and boost events are posted.GuildEditSpec
setVerificationLevel(Guild.VerificationLevel verificationLevel)
Sets the verification level required before a member can send messages in the modifiedGuild
.
-
-
-
Method Detail
-
setName
public GuildEditSpec setName(String name)
Sets the modifiedGuild
name.- Parameters:
name
- the guild name- Returns:
- this spec
-
setRegion
public GuildEditSpec setRegion(Region.Id regionId)
Sets the voice region for the modifiedGuild
.- Parameters:
regionId
- The voice region for the guild.- Returns:
- This spec.
-
setRegion
public GuildEditSpec setRegion(@Nullable String regionId)
Sets the voice region for the modifiedGuild
, automatic if null.- Parameters:
regionId
- The voice region for the guild, automatic if null.- Returns:
- This spec.
-
setVerificationLevel
public GuildEditSpec setVerificationLevel(Guild.VerificationLevel verificationLevel)
Sets the verification level required before a member can send messages in the modifiedGuild
.- Parameters:
verificationLevel
- The verification level for the guild.- Returns:
- This spec.
-
setDefaultMessageNotificationsLevel
public GuildEditSpec setDefaultMessageNotificationsLevel(Guild.NotificationLevel notificationsLevel)
Sets the default message notification level for the modifiedGuild
.- Parameters:
notificationsLevel
- The default notification level for the guild.- Returns:
- This spec.
-
setExplicitContentFilter
public GuildEditSpec setExplicitContentFilter(Guild.ContentFilterLevel level)
Sets the explicit content filter level for the modifiedGuild
.- Parameters:
level
- The explicit content filter level for the guild.- Returns:
- This spec.
-
setAfkChannelId
public GuildEditSpec setAfkChannelId(@Nullable Snowflake afkChannelId)
- Parameters:
afkChannelId
- The identifier for the AFK channel.- Returns:
- This spec.
-
setAfkTimeout
public GuildEditSpec setAfkTimeout(int afkTimeout)
Sets the AFK timeout, in seconds, for thisGuild
.- Parameters:
afkTimeout
- The AFK timeout, in seconds.- Returns:
- This spec.
-
setIcon
public GuildEditSpec setIcon(@Nullable Image icon)
Sets the image icon to display for the modifiedGuild
.- Parameters:
icon
- The icon for the guild.- Returns:
- This spec.
-
setOwnerId
public GuildEditSpec setOwnerId(Snowflake ownerId)
Sets the new owner ID for thisGuild
. Used to transfer guild ownership if this client is the owner.- Parameters:
ownerId
- The identifier for the new guild owner.- Returns:
- This spec.
-
setSplash
public GuildEditSpec setSplash(@Nullable Image splash)
Sets the image for the guild splash (when the server has the INVITE_SPLASH feature).- Parameters:
splash
- The image for the guild splash.- Returns:
- This spec.
-
setDiscoverySplash
public GuildEditSpec setDiscoverySplash(@Nullable Image discoverySplash)
Sets the image for the guild discovery splash (when the server has the DISCOVERABLE feature).- Parameters:
discoverySplash
- The image for the guild discovery splash.- Returns:
- This spec.
-
setBanner
public GuildEditSpec setBanner(@Nullable Image banner)
Sets the image for the guild banner (when the server has the BANNER feature).- Parameters:
banner
- The image for the guild banner.- Returns:
- This spec.
-
setSystemChannelId
public GuildEditSpec setSystemChannelId(@Nullable Snowflake systemChannelId)
Sets the id of the channel where guild notices such as welcome messages and boost events are posted.- Parameters:
systemChannelId
- The id of the channel where guild notices such as welcome messages and boost events are posted.- Returns:
- This spec.
-
setSystemChannelFlags
@Deprecated public GuildEditSpec setSystemChannelFlags(@Nullable Guild.SystemChannelFlag flag)
Deprecated.Sets the system channel flags.- Parameters:
flag
- The system channel flags.- Returns:
- This spec.
-
setSystemChannelFlags
public GuildEditSpec setSystemChannelFlags(@Nullable Guild.SystemChannelFlag... flags)
Sets the system channel flags.- Parameters:
flags
- The system channel flags.- Returns:
- This spec.
-
setRulesChannelId
public GuildEditSpec setRulesChannelId(@Nullable Snowflake rulesChannelId)
Sets the id of the channel where Community guilds display rules and/or guidelines.- Parameters:
rulesChannelId
- The id of the channel where Community guilds display rules and/or guidelines.- Returns:
- This spec.
-
setPublicUpdatesChannelId
public GuildEditSpec setPublicUpdatesChannelId(@Nullable Snowflake publicUpdatesChannelId)
Sets the id of the channel where admins and moderators of Community guilds receive notices from Discord.- Parameters:
publicUpdatesChannelId
- The id of the channel where admins and moderators of Community guilds receive notices from Discord.- Returns:
- This spec.
-
setPreferredLocale
public GuildEditSpec setPreferredLocale(@Nullable Locale preferredLocale)
Sets the preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US".- Parameters:
preferredLocale
- The preferred locale of a Community guild used in server discovery and notices from Discord.- Returns:
- This spec.
-
setFeatures
public GuildEditSpec setFeatures(Set<String> features)
Sets the enabled guild features.
You can see the available guild features- Parameters:
features
- Enabled guild features.- Returns:
- This spec.
-
setDescription
public GuildEditSpec setDescription(@Nullable String description)
Sets the description for the guild, if the guild is discoverable.- Parameters:
description
- The description for the guild.- Returns:
- This spec.
-
setReason
public GuildEditSpec setReason(@Nullable String reason)
Description copied from interface:AuditSpec
Sets the reason to show in the audit logs when the spec is built.
-
getReason
@Nullable public String getReason()
Description copied from interface:AuditSpec
Returns the current audit log reason set on the spec.
-
-