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
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Method Summary
Modifier and TypeMethodDescriptionboolean
long
The 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, ornull
if 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, ornull
if 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 guildint
hashCode()
boolean
Shows 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:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in 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 notavailable
NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
-
getVoiceChannelById
Gets a voice channel with the given ID, ornull
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 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 providedid
cannot be parsed byLong.parseLong(String)
IllegalStateException
- If the widget is notavailable
-
getMemberById
Gets a member with the given ID, ornull
if 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
-