Interface IGuildChannelContainer<C extends Channel>
- All Known Subinterfaces:
Guild
,JDA
,ShardManager
- All Known Implementing Classes:
DefaultShardManager
These getters only check the caches with the relevant scoping of the implementing type.
For example, Guild
returns channels that exist within the guild,
whereas JDA
or ShardManager
returns any channels that exist within the shard.
If this is called on JDA
or ShardManager
, this may return null immediately after building, because the cache isn't initialized yet.
To make sure the cache is initialized after building your JDA
instance, you can use JDA.awaitReady()
.
For the most efficient usage, it is recommended to use CacheView
getters such as getTextChannelCache()
.
List getters usually require making a snapshot copy of the underlying cache view, which may introduce an undesirable performance hit.
-
Method Summary
Modifier and TypeMethodDescriptionGets allCategories
in the cache.getCategoriesByName
(String name, boolean ignoreCase) Gets a list of allCategories
in this Guild that have the same name as the one provided.default Category
getCategoryById
(long id) Gets aCategory
that has the same id as the one provided.default Category
Gets aCategory
that has the same id as the one provided.SortedSnowflakeCacheView
ofCategory
.default <T extends C>
TgetChannelById
(Class<T> type, long id) Get a channel of the specified type by id.default <T extends C>
TgetChannelById
(Class<T> type, String id) Get a channel of the specified type by id.Unified cache of all channels associated with this shard or guild.default ForumChannel
getForumChannelById
(long id) Gets aForumChannel
that has the same id as the one provided.default ForumChannel
Gets aForumChannel
that has the same id as the one provided.default @Unmodifiable List<ForumChannel>
Gets allForumChannel
in the cache.default @Unmodifiable List<ForumChannel>
getForumChannelsByName
(String name, boolean ignoreCase) Gets a list of allForumChannels
in this Guild that have the same name as the one provided.default GuildChannel
getGuildChannelById
(long id) GetGuildChannel
for the provided ID.default GuildChannel
GetGuildChannel
for the provided ID.default GuildChannel
getGuildChannelById
(ChannelType type, long id) GetGuildChannel
for the provided ID.default GuildChannel
getGuildChannelById
(ChannelType type, String id) GetGuildChannel
for the provided ID.default MediaChannel
getMediaChannelById
(long id) Gets aMediaChannel
that has the same id as the one provided.default MediaChannel
Gets aMediaChannel
that has the same id as the one provided.default @Unmodifiable List<MediaChannel>
Gets allMediaChannel
in the cache.default @Unmodifiable List<MediaChannel>
getMediaChannelsByName
(String name, boolean ignoreCase) Gets a list of allMediaChannels
in this Guild that have the same name as the one provided.default NewsChannel
getNewsChannelById
(long id) Gets aNewsChannel
that has the same id as the one provided.default NewsChannel
Gets aNewsChannel
that has the same id as the one provided.SortedSnowflakeCacheView
ofNewsChannel
.default @Unmodifiable List<NewsChannel>
Gets allNewsChannels
in the cache.default @Unmodifiable List<NewsChannel>
getNewsChannelsByName
(String name, boolean ignoreCase) Gets a list of allNewsChannels
in this Guild that have the same name as the one provided.default StageChannel
getStageChannelById
(long id) Gets aStageChannel
that has the same id as the one provided.default StageChannel
Gets aStageChannel
that has the same id as the one provided.SortedSnowflakeCacheView
ofStageChannel
.default @Unmodifiable List<StageChannel>
Gets allStageChannels
in the cache.default @Unmodifiable List<StageChannel>
getStageChannelsByName
(String name, boolean ignoreCase) Gets a list of allStageChannels
in this Guild that have the same name as the one provided.default TextChannel
getTextChannelById
(long id) Gets aTextChannel
that has the same id as the one provided.default TextChannel
Gets aTextChannel
that has the same id as the one provided.SortedSnowflakeCacheView
ofTextChannel
.default @Unmodifiable List<TextChannel>
Gets allTextChannels
in the cache.default @Unmodifiable List<TextChannel>
getTextChannelsByName
(String name, boolean ignoreCase) Gets a list of allTextChannels
in this Guild that have the same name as the one provided.default ThreadChannel
getThreadChannelById
(long id) Gets aThreadChannel
that has the same id as the one provided.default ThreadChannel
Gets aThreadChannel
that has the same id as the one provided.default @Unmodifiable List<ThreadChannel>
Gets allThreadChannel
in the cache.default @Unmodifiable List<ThreadChannel>
getThreadChannelsByName
(String name, boolean ignoreCase) Gets a list of allThreadChannels
in this Guild that have the same name as the one provided.default VoiceChannel
getVoiceChannelById
(long id) Gets aVoiceChannel
that has the same id as the one provided.default VoiceChannel
Gets aVoiceChannel
that has the same id as the one provided.SortedSnowflakeCacheView
ofVoiceChannel
.default @Unmodifiable List<VoiceChannel>
Gets allVoiceChannels
in the cache.default @Unmodifiable List<VoiceChannel>
getVoiceChannelsByName
(String name, boolean ignoreCase) Gets a list of allVoiceChannels
in this Guild that have the same name as the one provided.
-
Method Details
-
getChannelCache
Unified cache of all channels associated with this shard or guild.This
ChannelCacheView
stores all channels in individually typed maps based onChannelType
. You can useChannelCacheView.getElementById(ChannelType, long)
orChannelCacheView.ofType(Class)
to filter out more specific types.- Returns:
ChannelCacheView
-
getChannelById
Get a channel of the specified type by id.This will automatically check for all channel types and cast to the specified class. If a channel with the specified id does not exist, or exists but is not an instance of the provided class, this returns null.
- Type Parameters:
T
- The type argument for the class- Parameters:
type
-Class
of a channel typeid
- The snowflake id of the channel- Returns:
- The casted channel, if it exists and is assignable to the provided class, or null
- Throws:
IllegalArgumentException
- If null is provided, or the id is not a valid snowflake
-
getChannelById
Get a channel of the specified type by id.This will automatically check for all channel types and cast to the specified class. If a channel with the specified id does not exist, or exists but is not an instance of the provided class, this returns null.
- Type Parameters:
T
- The type argument for the class- Parameters:
type
-Class
of a channel typeid
- The snowflake id of the channel- Returns:
- The casted channel, if it exists and is assignable to the provided class, or null
- Throws:
IllegalArgumentException
- If null is provided
-
getGuildChannelById
GetGuildChannel
for the provided ID.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.To get more specific channel types you can use one of the following:
- Parameters:
id
- The ID of the channel- Returns:
- The GuildChannel or null
- Throws:
IllegalArgumentException
- If the provided ID is nullNumberFormatException
- If the provided ID is not a snowflake
-
getGuildChannelById
GetGuildChannel
for the provided ID.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.To get more specific channel types you can use one of the following:
- Parameters:
id
- The ID of the channel- Returns:
- The GuildChannel or null
-
getGuildChannelById
GetGuildChannel
for the provided ID.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.
This is meant for systems that use a dynamicChannelType
and can profit from a simple function to get the channel instance.To get more specific channel types you can use one of the following:
- Parameters:
type
- TheChannelType
id
- The ID of the channel- Returns:
- The GuildChannel or null
- Throws:
IllegalArgumentException
- If the provided ID is nullNumberFormatException
- If the provided ID is not a snowflake
-
getGuildChannelById
GetGuildChannel
for the provided ID.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.
This is meant for systems that use a dynamicChannelType
and can profit from a simple function to get the channel instance.To get more specific channel types you can use one of the following:
- Parameters:
type
- TheChannelType
id
- The ID of the channel- Returns:
- The GuildChannel or null
-
getStageChannelCache
SortedSnowflakeCacheView
ofStageChannel
.
InGuild
cache, channels are sorted according to their position and id.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
SortedSnowflakeCacheView
-
getStageChannelsByName
@Nonnull default @Unmodifiable List<StageChannel> getStageChannelsByName(@Nonnull String name, boolean ignoreCase) Gets a list of allStageChannels
in this Guild that have the same name as the one provided.
If there are no channels with the provided name, then this returns an empty list.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
name
- The name used to filter the returnedStageChannels
.ignoreCase
- Determines if the comparison ignores case when comparing. True - case insensitive.- Returns:
- Possibly-empty immutable list of all StageChannel names that match the provided name.
-
getStageChannelById
Gets aStageChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theStageChannel
.- Returns:
- Possibly-null
StageChannel
with matching id. - Throws:
NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
-
getStageChannelById
Gets aStageChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theStageChannel
.- Returns:
- Possibly-null
StageChannel
with matching id.
-
getStageChannels
Gets allStageChannels
in the cache.
InGuild
cache, channels are sorted according to their position and id.This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use
getStageChannelCache()
and use its more efficient versions of handling these values.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
- An immutable List of
StageChannels
.
-
getThreadChannelCache
SnowflakeCacheView
ofThreadChannel
.These threads can also represent posts in
ForumChannels
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
SnowflakeCacheView
-
getThreadChannelsByName
@Nonnull default @Unmodifiable List<ThreadChannel> getThreadChannelsByName(@Nonnull String name, boolean ignoreCase) Gets a list of allThreadChannels
in this Guild that have the same name as the one provided.
If there are no channels with the provided name, then this returns an empty list.These threads can also represent posts in
ForumChannels
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
name
- The name used to filter the returnedThreadChannels
.ignoreCase
- Determines if the comparison ignores case when comparing. True - case insensitive.- Returns:
- Possibly-empty immutable list of all ThreadChannel names that match the provided name.
-
getThreadChannelById
Gets aThreadChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.These threads can also represent posts in
ForumChannels
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theThreadChannel
.- Returns:
- Possibly-null
ThreadChannel
with matching id. - Throws:
NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
-
getThreadChannelById
Gets aThreadChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.These threads can also represent posts in
ForumChannels
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theThreadChannel
.- Returns:
- Possibly-null
ThreadChannel
with matching id.
-
getThreadChannels
Gets allThreadChannel
in the cache.These threads can also represent posts in
ForumChannels
.This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use
getThreadChannelCache()
and use its more efficient versions of handling these values.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
- An immutable List of
ThreadChannels
.
-
getCategoryCache
SortedSnowflakeCacheView
ofCategory
.
InGuild
cache, channels are sorted according to their position and id.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
SortedSnowflakeCacheView
-
getCategoriesByName
@Nonnull default @Unmodifiable List<Category> getCategoriesByName(@Nonnull String name, boolean ignoreCase) Gets a list of allCategories
in this Guild that have the same name as the one provided.
If there are no channels with the provided name, then this returns an empty list.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
name
- The name to checkignoreCase
- Whether to ignore case on name checking- Returns:
- Immutable list of all categories matching the provided name
- Throws:
IllegalArgumentException
- If the provided name isnull
-
getCategoryById
Gets aCategory
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The snowflake ID of the wanted Category- Returns:
- Possibly-null
Category
for the provided ID. - Throws:
IllegalArgumentException
- If the provided ID is not a validlong
-
getCategoryById
Gets aCategory
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The snowflake ID of the wanted Category- Returns:
- Possibly-null
Category
for the provided ID.
-
getCategories
Gets allCategories
in the cache.
InGuild
cache, channels are sorted according to their position and id.This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use
getCategoryCache()
and use its more efficient versions of handling these values.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
- An immutable list of all
Categories
in this Guild.
-
getTextChannelCache
SortedSnowflakeCacheView
ofTextChannel
.
InGuild
cache, channels are sorted according to their position and id.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
SortedSnowflakeCacheView
-
getTextChannelsByName
@Nonnull default @Unmodifiable List<TextChannel> getTextChannelsByName(@Nonnull String name, boolean ignoreCase) Gets a list of allTextChannels
in this Guild that have the same name as the one provided.
If there are no channels with the provided name, then this returns an empty list.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
name
- The name used to filter the returnedTextChannels
.ignoreCase
- Determines if the comparison ignores case when comparing. True - case insensitive.- Returns:
- Possibly-empty immutable list of all TextChannels names that match the provided name.
-
getTextChannelById
Gets aTextChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theTextChannel
.- Returns:
- Possibly-null
TextChannel
with matching id. - Throws:
NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
-
getTextChannelById
Gets aTextChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theTextChannel
.- Returns:
- Possibly-null
TextChannel
with matching id.
-
getTextChannels
Gets allTextChannels
in the cache.
InGuild
cache, channels are sorted according to their position and id.This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use
getTextChannelCache()
and use its more efficient versions of handling these values.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
- An immutable List of all
TextChannels
in this Guild.
-
getNewsChannelCache
SortedSnowflakeCacheView
ofNewsChannel
.
InGuild
cache, channels are sorted according to their position and id.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
SortedSnowflakeCacheView
-
getNewsChannelsByName
@Nonnull default @Unmodifiable List<NewsChannel> getNewsChannelsByName(@Nonnull String name, boolean ignoreCase) Gets a list of allNewsChannels
in this Guild that have the same name as the one provided.
If there are no channels with the provided name, then this returns an empty list.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
name
- The name used to filter the returnedNewsChannels
.ignoreCase
- Determines if the comparison ignores case when comparing. True - case insensitive.- Returns:
- Possibly-empty immutable list of all NewsChannels names that match the provided name.
-
getNewsChannelById
Gets aNewsChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theNewsChannel
.- Returns:
- Possibly-null
NewsChannel
with matching id. - Throws:
NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
-
getNewsChannelById
Gets aNewsChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theNewsChannel
.- Returns:
- Possibly-null
NewsChannel
with matching id.
-
getNewsChannels
Gets allNewsChannels
in the cache.
InGuild
cache, channels are sorted according to their position and id.This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use
getNewsChannelCache()
and use its more efficient versions of handling these values.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
- An immutable List of all
NewsChannels
in this Guild.
-
getVoiceChannelCache
SortedSnowflakeCacheView
ofVoiceChannel
.
InGuild
cache, channels are sorted according to their position and id.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
SortedSnowflakeCacheView
-
getVoiceChannelsByName
@Nonnull default @Unmodifiable List<VoiceChannel> getVoiceChannelsByName(@Nonnull String name, boolean ignoreCase) Gets a list of allVoiceChannels
in this Guild that have the same name as the one provided.
If there are no channels with the provided name, then this returns an empty list.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
name
- The name used to filter the returnedVoiceChannels
.ignoreCase
- Determines if the comparison ignores case when comparing. True - case insensitive.- Returns:
- Possibly-empty immutable list of all VoiceChannel names that match the provided name.
-
getVoiceChannelById
Gets aVoiceChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theVoiceChannel
.- Returns:
- Possibly-null
VoiceChannel
with matching id. - Throws:
NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
-
getVoiceChannelById
Gets aVoiceChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theVoiceChannel
.- Returns:
- Possibly-null
VoiceChannel
with matching id.
-
getVoiceChannels
Gets allVoiceChannels
in the cache.
InGuild
cache, channels are sorted according to their position and id.This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use
getVoiceChannelCache()
and use its more efficient versions of handling these values.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
- An immutable List of
VoiceChannels
.
-
getForumChannelCache
SnowflakeCacheView
ofForumChannel
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
SnowflakeCacheView
-
getForumChannelsByName
@Nonnull default @Unmodifiable List<ForumChannel> getForumChannelsByName(@Nonnull String name, boolean ignoreCase) Gets a list of allForumChannels
in this Guild that have the same name as the one provided.
If there are no channels with the provided name, then this returns an empty list.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
name
- The name used to filter the returnedForumChannels
.ignoreCase
- Determines if the comparison ignores case when comparing. True - case insensitive.- Returns:
- Possibly-empty immutable list of all ForumChannel names that match the provided name.
-
getForumChannelById
Gets aForumChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theForumChannel
.- Returns:
- Possibly-null
ForumChannel
with matching id. - Throws:
NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
-
getForumChannelById
Gets aForumChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theForumChannel
.- Returns:
- Possibly-null
ForumChannel
with matching id.
-
getForumChannels
Gets allForumChannel
in the cache.This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use
getForumChannelCache()
and use its more efficient versions of handling these values.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
- An immutable List of
ForumChannel
.
-
getMediaChannelCache
SnowflakeCacheView
ofMediaChannel
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
SnowflakeCacheView
-
getMediaChannelsByName
@Nonnull default @Unmodifiable List<MediaChannel> getMediaChannelsByName(@Nonnull String name, boolean ignoreCase) Gets a list of allMediaChannels
in this Guild that have the same name as the one provided.
If there are no channels with the provided name, then this returns an empty list.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
name
- The name used to filter the returnedMediaChannels
.ignoreCase
- Determines if the comparison ignores case when comparing. True - case insensitive.- Returns:
- Possibly-empty immutable list of all ForumChannel names that match the provided name.
-
getMediaChannelById
Gets aMediaChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theMediaChannel
.- Returns:
- Possibly-null
MediaChannel
with matching id. - Throws:
NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
-
getMediaChannelById
Gets aMediaChannel
that has the same id as the one provided.
If there is no channel with an id that matches the provided one, then this returnsnull
.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Parameters:
id
- The id of theMediaChannel
.- Returns:
- Possibly-null
MediaChannel
with matching id.
-
getMediaChannels
Gets allMediaChannel
in the cache.This copies the backing store into a list. This means every call creates a new list with O(n) complexity. It is recommended to store this into a local variable or use
getForumChannelCache()
and use its more efficient versions of handling these values.This getter exists on any instance of
IGuildChannelContainer
and only checks the caches with the relevant scoping. ForGuild
,JDA
, orShardManager
, this returns the relevant channel with respect to the cache within each of those objects. For a guild, this would mean it only returns channels within the same guild.
If this is called onJDA
orShardManager
, this may return null immediately after building, because the cache isn't initialized yet. To make sure the cache is initialized after building yourJDA
instance, you can useJDA.awaitReady()
.- Returns:
- An immutable List of
MediaChannel
.
-