Package net.dv8tion.jda.api.entities
Enum Guild.Timeout
- All Implemented Interfaces:
Serializable
,Comparable<Guild.Timeout>
- Enclosing interface:
Guild
Represents the idle time allowed until a user is moved to the
AFK
VoiceChannel
if one is set
(Guild.getAfkChannel()
).-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Guild.Timeout
fromKey
(int seconds) Retrieves theTimeout
based on the amount of seconds requested.int
The amount of seconds represented by thisGuild.Timeout
.static Guild.Timeout
Returns the enum constant of this type with the specified name.static Guild.Timeout[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SECONDS_60
-
SECONDS_300
-
SECONDS_900
-
SECONDS_1800
-
SECONDS_3600
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getSeconds
public int getSeconds()The amount of seconds represented by thisGuild.Timeout
.- Returns:
- An positive non-negative int representing the timeout amount in seconds.
-
fromKey
Retrieves theTimeout
based on the amount of seconds requested.
If theseconds
amount provided is not valid for Discord, an IllegalArgumentException will be thrown.- Parameters:
seconds
- The amount of seconds before idle timeout.- Returns:
- The
Timeout
related to the amount of seconds provided. - Throws:
IllegalArgumentException
- If the providedseconds
is an invalid timeout amount.
-