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
public static class WidgetUtil.Widget extends Object implements ISnowflake
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWidgetUtil.Widget.Memberstatic classWidgetUtil.Widget.VoiceChannelstatic classWidgetUtil.Widget.VoiceState
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)longgetIdLong()The Snowflake id of this entity.StringgetInviteCode()Gets an invite code for the guild, or null if no invite channel is enabled in the widgetWidgetUtil.Widget.MembergetMemberById(long id)Gets a member with the given ID, ornullif the member is not foundWidgetUtil.Widget.MembergetMemberById(String id)Gets a member with the given ID, or null if the member is not foundList<WidgetUtil.Widget.Member>getMembers()Gets a list of online members in the guildStringgetName()Gets the name of the guildWidgetUtil.Widget.VoiceChannelgetVoiceChannelById(long id)Gets a voice channel with the given ID, ornullif the voice channel is not foundWidgetUtil.Widget.VoiceChannelgetVoiceChannelById(String id)Gets a voice channel with the given ID, or null if the voice channel is not foundList<WidgetUtil.Widget.VoiceChannel>getVoiceChannels()Gets the list of voice channels in the guildinthashCode()booleanisAvailable()Shows whether or not the widget for a guild is available.StringtoString()-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
-
-
-
Method Detail
-
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
@Nonnull public String getName()
Gets the name of the guild- Returns:
- the name of the guild
- Throws:
IllegalStateException- If the widget is notavailable
-
getInviteCode
@Nullable public String 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
@Nonnull public List<WidgetUtil.Widget.VoiceChannel> 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
@Nullable public WidgetUtil.Widget.VoiceChannel getVoiceChannelById(String id)
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
@Nullable public WidgetUtil.Widget.VoiceChannel getVoiceChannelById(long id)
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
@Nonnull public List<WidgetUtil.Widget.Member> getMembers()
Gets a list of online members in the guild- Returns:
- the list of members
- Throws:
IllegalStateException- If the widget is notavailable
-
getMemberById
@Nullable public WidgetUtil.Widget.Member getMemberById(String id)
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
@Nullable public WidgetUtil.Widget.Member getMemberById(long id)
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
-
-