public class GuildImpl extends java.lang.Object implements Guild
Guild.MFALevel, Guild.NotificationLevel, Guild.VerificationLevel
Constructor and Description |
---|
GuildImpl(JDAImpl api,
java.lang.String id) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkVerification()
Checks if the current Verification-level of this guild allows JDA to send messages to it.
|
boolean |
equals(java.lang.Object o) |
VoiceChannel |
getAfkChannel() |
int |
getAfkTimeout()
The amount of time (in seconds) that must pass with no activity to be considered AFK by this
Guild . |
java.util.HashMap<java.lang.String,org.json.JSONObject> |
getCachedPresenceMap() |
Guild.NotificationLevel |
getDefaultNotificationLevel()
Returns the default message Notification-Level of this Guild.
|
java.lang.String |
getIconId()
The Discord Id of the
Guild icon image. |
java.lang.String |
getIconUrl()
The URL of the
Guild icon image. |
java.lang.String |
getId()
The Snowflake id of this entity.
|
JDA |
getJDA()
Returns the
JDA instance of this Guild |
Member |
getMember(User user) |
Member |
getMemberById(java.lang.String userId) |
java.util.List<Member> |
getMembers() |
java.util.List<Member> |
getMembersByEffectiveName(java.lang.String name,
boolean ignoreCase) |
java.util.List<Member> |
getMembersByName(java.lang.String name,
boolean ignoreCase) |
java.util.List<Member> |
getMembersByNickname(java.lang.String nickname,
boolean ignoreCase) |
java.util.HashMap<java.lang.String,Member> |
getMembersMap() |
java.util.List<Member> |
getMembersWithRoles(java.util.Collection<Role> roles) |
java.util.List<Member> |
getMembersWithRoles(Role... roles) |
java.lang.String |
getName()
The human readable name of the
Guild . |
Member |
getOwner()
|
TextChannel |
getPublicChannel()
The default
TextChannel for a Guild . |
Role |
getPublicRole()
|
Region |
getRegion()
|
Guild.MFALevel |
getRequiredMFALevel()
Returns the level of multifactor authentication required to execute administrator restricted functions in this guild.
|
Role |
getRoleById(java.lang.String id)
|
java.util.List<Role> |
getRoles()
|
java.util.List<Role> |
getRolesByName(java.lang.String name,
boolean ignoreCase) |
java.util.HashMap<java.lang.String,Role> |
getRolesMap() |
Member |
getSelfMember() |
java.lang.String |
getSplashId() |
java.lang.String |
getSplashUrl() |
TextChannel |
getTextChannelById(java.lang.String id) |
java.util.List<TextChannel> |
getTextChannels()
The
TextChannels available on the Guild . |
java.util.List<TextChannel> |
getTextChannelsByName(java.lang.String name,
boolean ignoreCase) |
java.util.HashMap<java.lang.String,TextChannel> |
getTextChannelsMap() |
Guild.VerificationLevel |
getVerificationLevel()
Returns the verification-Level of this Guild.
|
VoiceChannel |
getVoiceChannelById(java.lang.String id) |
java.util.HashMap<java.lang.String,VoiceChannel> |
getVoiceChannelMap() |
java.util.List<VoiceChannel> |
getVoiceChannels()
The
VoiceChannels available on the Guild . |
java.util.List<VoiceChannel> |
getVoiceChannelsByName(java.lang.String name,
boolean ignoreCase) |
java.util.List<VoiceState> |
getVoiceStates()
A list containing the
VoiceState of every Member
in this Guild .This will never return an empty list because if it were empty, that would imply that there are no Members in this Guild , which is
impossible. |
int |
hashCode() |
boolean |
isAvailable()
Returns whether or not this Guild is available.
|
boolean |
isMember(User user)
Used to determine the provided
User is a member of this Guild. |
GuildImpl |
setAfkChannel(VoiceChannel afkChannel) |
GuildImpl |
setAfkTimeout(int afkTimeout) |
GuildImpl |
setAvailable(boolean available) |
GuildImpl |
setDefaultNotificationLevel(Guild.NotificationLevel level) |
GuildImpl |
setIconId(java.lang.String iconId) |
GuildImpl |
setName(java.lang.String name) |
GuildImpl |
setOwner(Member owner) |
GuildImpl |
setPublicChannel(TextChannel publicChannel) |
GuildImpl |
setPublicRole(Role publicRole) |
GuildImpl |
setRegion(Region region) |
GuildImpl |
setRequiredMFALevel(Guild.MFALevel level) |
GuildImpl |
setSplashId(java.lang.String splashId) |
GuildImpl |
setVerificationLevel(Guild.VerificationLevel level) |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getCreationTime
public GuildImpl(JDAImpl api, java.lang.String id)
public java.lang.String getName()
Guild
Guild
. If no name has been set, this returns null.public java.lang.String getIconId()
Guild
Guild
icon image. If no icon has been set, this returns null.public java.lang.String getIconUrl()
Guild
Guild
icon image. If no icon has been set, this returns null.getIconUrl
in interface Guild
public java.lang.String getSplashId()
getSplashId
in interface Guild
public java.lang.String getSplashUrl()
getSplashUrl
in interface Guild
public VoiceChannel getAfkChannel()
getAfkChannel
in interface Guild
public int getAfkTimeout()
Guild
Guild
.
Default is 300 seconds (5 minutes)getAfkTimeout
in interface Guild
public boolean isMember(User user)
Guild
User
is a member of this Guild.public Member getMemberById(java.lang.String userId)
getMemberById
in interface Guild
public java.util.List<Member> getMembers()
getMembers
in interface Guild
public java.util.List<Member> getMembersByName(java.lang.String name, boolean ignoreCase)
getMembersByName
in interface Guild
public java.util.List<Member> getMembersByNickname(java.lang.String nickname, boolean ignoreCase)
getMembersByNickname
in interface Guild
public java.util.List<Member> getMembersByEffectiveName(java.lang.String name, boolean ignoreCase)
getMembersByEffectiveName
in interface Guild
public java.util.List<Member> getMembersWithRoles(Role... roles)
getMembersWithRoles
in interface Guild
public java.util.List<Member> getMembersWithRoles(java.util.Collection<Role> roles)
getMembersWithRoles
in interface Guild
public TextChannel getTextChannelById(java.lang.String id)
getTextChannelById
in interface Guild
public java.util.List<TextChannel> getTextChannelsByName(java.lang.String name, boolean ignoreCase)
getTextChannelsByName
in interface Guild
public java.util.List<TextChannel> getTextChannels()
Guild
TextChannels
available on the Guild
.
The channels returned will be sorted according to their position.getTextChannels
in interface Guild
TextChannels
.public VoiceChannel getVoiceChannelById(java.lang.String id)
getVoiceChannelById
in interface Guild
public java.util.List<VoiceChannel> getVoiceChannelsByName(java.lang.String name, boolean ignoreCase)
getVoiceChannelsByName
in interface Guild
public java.util.List<VoiceChannel> getVoiceChannels()
Guild
VoiceChannels
available on the Guild
.
The channels returned will be sorted according to their position.getVoiceChannels
in interface Guild
VoiceChannels
.public Role getRoleById(java.lang.String id)
Guild
Role
which has the same id as the one provided.Role
that matches the requested id, null
is returned.getRoleById
in interface Guild
id
- The id of the Role
.public java.util.List<Role> getRolesByName(java.lang.String name, boolean ignoreCase)
getRolesByName
in interface Guild
public Role getPublicRole()
Guild
getPublicRole
in interface Guild
Role
public TextChannel getPublicChannel()
Guild
TextChannel
for a Guild
.
This channel cannot be deleted and the Public Role
always has the ability to
Permission.MESSAGE_READ
this channel.getPublicChannel
in interface Guild
TextChannel
representing the public channel for this guild.public JDA getJDA()
Guild
JDA
instance of this Guildpublic java.util.List<VoiceState> getVoiceStates()
Guild
VoiceState
of every Member
in this Guild
.Members
in this Guild
, which is
impossible.getVoiceStates
in interface Guild
VoiceStates
on this Guild
.public Guild.VerificationLevel getVerificationLevel()
Guild
Guild.VerificationLevel
.getVerificationLevel
in interface Guild
public Guild.NotificationLevel getDefaultNotificationLevel()
Guild
NotificationLevel
.getDefaultNotificationLevel
in interface Guild
public Guild.MFALevel getRequiredMFALevel()
Guild
MFALevel
.getRequiredMFALevel
in interface Guild
public boolean checkVerification()
Guild
checkVerification
in interface Guild
VerificationLevel Enum with a list of possible verification-levels and their requirements
public boolean isAvailable()
Guild
isAvailable
in interface Guild
public java.lang.String getId()
ISnowflake
getId
in interface ISnowflake
public GuildImpl setAvailable(boolean available)
public GuildImpl setName(java.lang.String name)
public GuildImpl setIconId(java.lang.String iconId)
public GuildImpl setSplashId(java.lang.String splashId)
public GuildImpl setPublicChannel(TextChannel publicChannel)
public GuildImpl setAfkChannel(VoiceChannel afkChannel)
public GuildImpl setVerificationLevel(Guild.VerificationLevel level)
public GuildImpl setDefaultNotificationLevel(Guild.NotificationLevel level)
public GuildImpl setRequiredMFALevel(Guild.MFALevel level)
public GuildImpl setAfkTimeout(int afkTimeout)
public java.util.HashMap<java.lang.String,TextChannel> getTextChannelsMap()
public java.util.HashMap<java.lang.String,VoiceChannel> getVoiceChannelMap()
public java.util.HashMap<java.lang.String,Member> getMembersMap()
public java.util.HashMap<java.lang.String,Role> getRolesMap()
public java.util.HashMap<java.lang.String,org.json.JSONObject> getCachedPresenceMap()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Member getSelfMember()