Class JDAContext
java.lang.Object
com.github.kaktushose.jda.commands.internal.JDAContext
Wrapper class for
JDA
and ShardManager
. Use performTask(Consumer)
when you need to do work with an JDA
object.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.dv8tion.jda.api.utils.cache.SnowflakeCacheView
<net.dv8tion.jda.api.entities.Guild> SnowflakeCacheView
of all cachedGuild
s.void
performTask
(Consumer<net.dv8tion.jda.api.JDA> consumer) Performs an operation on either theJDA
object or on all shards.
-
Constructor Details
-
JDAContext
Constructs a new JDAContext.- Parameters:
context
- theJDA
orShardManager
object
-
-
Method Details
-
performTask
Performs an operation on either theJDA
object or on all shards.- Parameters:
consumer
- the operation to perform
-
getGuildCache
public net.dv8tion.jda.api.utils.cache.SnowflakeCacheView<net.dv8tion.jda.api.entities.Guild> getGuildCache()SnowflakeCacheView
of all cachedGuild
s.- Returns:
SnowflakeCacheView
-