Package net.dv8tion.jda.api.entities
Interface Widget
- All Superinterfaces:
ISnowflake
Represents a guild's widget
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents a member of a guildstatic interface
Represents a voice channelstatic interface
Represents aMember's
voice state -
Method Summary
Modifier and TypeMethodDescriptionGets 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 guildboolean
Shows whether or not the widget for a guild is available.Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
isAvailable
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
-
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
-