Package net.dv8tion.jda.api.utils
Class WidgetUtil.Widget
java.lang.Object
net.dv8tion.jda.api.utils.WidgetUtil.Widget
- All Implemented Interfaces:
ISnowflake
- Enclosing class:
- WidgetUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongThe Snowflake id of this entity.Gets an invite code for the guild, or null if no invite channel is enabled in the widgetgetMemberById(long id) Gets a member with the given ID, ornullif the member is not foundgetMemberById(String id) Gets a member with the given ID, or null if the member is not foundGets a list of online members in the guildgetName()Gets the name of the guildgetVoiceChannelById(long id) Gets a voice channel with the given ID, ornullif the voice channel is not foundGets a voice channel with the given ID, or null if the voice channel is not foundGets the list of voice channels in the guildinthashCode()booleanShows whether or not the widget for a guild is available.toString()Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Method Details
-
isAvailable
public boolean isAvailable()Shows whether or not the widget for a guild is available. If this method returns false, all other values will be null- Returns:
- True, if the widget is available, false otherwise
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflakeThe Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLongin interfaceISnowflake- Returns:
- Long containing the Id.
-
getName
Gets the name of the guild- Returns:
- the name of the guild
- Throws:
IllegalStateException- If the widget is notavailable
-
getInviteCode
Gets an invite code for the guild, or null if no invite channel is enabled in the widget- Returns:
- an invite code for the guild, if widget invites are enabled
- Throws:
IllegalStateException- If the widget is notavailable
-
getVoiceChannels
Gets the list of voice channels in the guild- Returns:
- the list of voice channels in the guild
- Throws:
IllegalStateException- If the widget is notavailable
-
getVoiceChannelById
Gets a voice channel with the given ID, or null if the voice channel is not found- Parameters:
id- the ID of the voice channel- Returns:
- possibly-null VoiceChannel with the given ID.
- Throws:
IllegalStateException- If the widget is notavailableNumberFormatException- If the providedidcannot be parsed byLong.parseLong(String)
-
getVoiceChannelById
Gets a voice channel with the given ID, ornullif the voice channel is not found- Parameters:
id- the ID of the voice channel- Returns:
- possibly-null VoiceChannel with the given ID.
- Throws:
IllegalStateException- If the widget is notavailable
-
getMembers
Gets a list of online members in the guild- Returns:
- the list of members
- Throws:
IllegalStateException- If the widget is notavailable
-
getMemberById
Gets a member with the given ID, or null if the member is not found- Parameters:
id- the ID of the member- Returns:
- possibly-null Member with the given ID.
- Throws:
NumberFormatException- If the providedidcannot be parsed byLong.parseLong(String)IllegalStateException- If the widget is notavailable
-
getMemberById
Gets a member with the given ID, ornullif the member is not found- Parameters:
id- the ID of the member- Returns:
- possibly-null Member with the given ID.
- Throws:
IllegalStateException- If the widget is notavailable
-
hashCode
public int hashCode() -
equals
-
toString
-