Enum Guild.Timeout

java.lang.Object
java.lang.Enum<Guild.Timeout>
net.dv8tion.jda.api.entities.Guild.Timeout
All Implemented Interfaces:
Serializable, Comparable<Guild.Timeout>
Enclosing interface:
Guild

public static enum Guild.Timeout extends Enum<Guild.Timeout>
Represents the idle time allowed until a user is moved to the AFK VoiceChannel if one is set (Guild.getAfkChannel()).
  • Enum Constant Details

  • Method Details

    • values

      public static Guild.Timeout[] 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

      public static Guild.Timeout valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getSeconds

      public int getSeconds()
      The amount of seconds represented by this Guild.Timeout.
      Returns:
      An positive non-negative int representing the timeout amount in seconds.
    • fromKey

      @Nonnull public static Guild.Timeout fromKey(int seconds)
      Retrieves the Timeout based on the amount of seconds requested.
      If the seconds 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 provided seconds is an invalid timeout amount.