Package net.dv8tion.jda.api.managers
Interface GuildWelcomeScreenManager
- All Superinterfaces:
AuditableRestAction<Void>
,Manager<GuildWelcomeScreenManager>
,RestAction<Void>
Manager providing functionality to update one or more fields for a
GuildWelcomeScreen
.
Example
manager.setEnabled(false)
.setDescription(null)
.setWelcomeChannels()
.queue();
manager.setEnabled(true)
.setDescription("Bot desc")
.setWelcomeChannels(Arrays.asList(
GuildWelcomeScreen.Channel.of(rulesChannel, "Read the rules first"),
GuildWelcomeScreen.Channel.of(generalChannel, "Go have a chat", Emoji.fromUnicode("U+1F4AC"))
))
.queue();
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Used to reset the channels fieldstatic final long
Used to reset the description fieldstatic final long
Used to reset the enabled fieldFields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptionRemoves all welcome channels.getGuild()
TheGuild
this Manager'sGuildWelcomeScreen
is in.@Unmodifiable List
<GuildWelcomeScreen.Channel> Returns an immutable list of the welcome channels
These channels are those which are being modified, not the ones currently shown on Discordreset
(long fields) Resets the fields specified by the provided bit-flag pattern.reset
(long... fields) Resets the specified fields.setDescription
(String description) Sets the description of the welcome screen.setEnabled
(boolean enabled) Sets the enabled state of the welcome screen.setWelcomeChannels
(Collection<? extends GuildWelcomeScreen.Channel> channels) Sets the welcome channels of the welcome screen.default GuildWelcomeScreenManager
setWelcomeChannels
(GuildWelcomeScreen.Channel... channels) Sets the welcome channels of the welcome screen.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
Field Details
-
ENABLED
static final long ENABLEDUsed to reset the enabled field- See Also:
-
DESCRIPTION
static final long DESCRIPTIONUsed to reset the description field- See Also:
-
CHANNELS
static final long CHANNELSUsed to reset the channels field- See Also:
-
-
Method Details
-
getGuild
TheGuild
this Manager'sGuildWelcomeScreen
is in.- Returns:
- The parent
Guild
-
reset
Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
Example:manager.reset(GuildWelcomeScreenManager.DESCRIPTION | GuildWelcomeScreenManager.CHANNELS);
Flag Constants:
- Specified by:
reset
in interfaceManager<GuildWelcomeScreenManager>
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- GuildWelcomeScreenManager for chaining convenience
-
reset
Resets the specified fields.
Example:manager.reset(GuildWelcomeScreenManager.DESCRIPTION, GuildWelcomeScreenManager.CHANNELS);
Flag Constants:
- Specified by:
reset
in interfaceManager<GuildWelcomeScreenManager>
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- GuildWelcomeScreenManager for chaining convenience
-
setEnabled
Sets the enabled state of the welcome screen.- Parameters:
enabled
-True
if the welcome screen should be enabled- Returns:
- GuildWelcomeScreenManager for chaining convenience
-
setDescription
Sets the description of the welcome screen.The description must not be longer than 140
- Parameters:
description
- The new description of the welcome screen, ornull
to remove the description- Returns:
- GuildWelcomeScreenManager for chaining convenience
- Throws:
IllegalArgumentException
- If the description longer than 140
-
getWelcomeChannels
Returns an immutable list of the welcome channels
These channels are those which are being modified, not the ones currently shown on Discord- Returns:
- An immutable list of the welcome channels to be set by the manager
-
clearWelcomeChannels
Removes all welcome channels.- Returns:
- GuildWelcomeScreenManager for chaining convenience
-
setWelcomeChannels
@Nonnull @CheckReturnValue GuildWelcomeScreenManager setWelcomeChannels(@Nonnull Collection<? extends GuildWelcomeScreen.Channel> channels) Sets the welcome channels of the welcome screen.The order of the
Collection
defines in what order the channels appear on Discord.- Parameters:
channels
- The new welcome channels to use, can be an empty list to remove all welcome channels.- Returns:
- GuildWelcomeScreenManager for chaining convenience
- Throws:
IllegalArgumentException
-- If
channels
isnull
- If more than 5 welcome channels are set
- If
- See Also:
-
setWelcomeChannels
@Nonnull @CheckReturnValue default GuildWelcomeScreenManager setWelcomeChannels(@Nonnull GuildWelcomeScreen.Channel... channels) Sets the welcome channels of the welcome screen.The order of the parameters defines in what order the channels appear on Discord.
- Parameters:
channels
- The new welcome channels to use, you can provide nothing in order to remove all welcome channels.- Returns:
- GuildWelcomeScreenManager for chaining convenience
- Throws:
IllegalArgumentException
-- If
channels
isnull
- If more than 5 welcome channels are set
- If
- See Also:
-