Class JDAContext
java.lang.Object
io.github.kaktushose.jdac.internal.JDAContext
Wrapper class for
JDA and ShardManager. Use performTask(Consumer, boolean) when you need to do work with an JDA object.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJDAContext(JDA jda) Constructs a new JDAContext.JDAContext(ShardManager shardManager) Constructs a new JDAContext. -
Method Summary
Modifier and TypeMethodDescriptionSnowflakeCacheViewof all cachedGuilds.voidperformTask(Consumer<JDA> consumer, boolean onlyFirstShard) Performs an operation on either theJDAobject or on all shards.voidshutdown()Shutdown the underlyingJDAorShardManagerinstance
-
Field Details
-
log
public static final org.slf4j.Logger log
-
-
Constructor Details
-
JDAContext
Constructs a new JDAContext.- Parameters:
shardManager- theShardManagerobject
-
JDAContext
-
-
Method Details
-
performTask
Performs an operation on either theJDAobject or on all shards.- Parameters:
consumer- the operation to performonlyFirstShard- whether this task should only be executed on the first shard if aShardManageris used
-
getGuildCache
SnowflakeCacheViewof all cachedGuilds.- Returns:
- the
SnowflakeCacheView
-
applicationEmojis
-
shutdown
public void shutdown()Shutdown the underlyingJDAorShardManagerinstance
-