Package xyz.norbjert.jda4spring.internal
Class JDA4SpringMain
java.lang.Object
xyz.norbjert.jda4spring.internal.JDA4SpringMain
handles the initialisation process of the individual DiscordBots and configures them with their tasks, activities and API tokens (and soon gateway intents)
-
Constructor Summary
ConstructorsConstructorDescriptionJDA4SpringMain(org.springframework.context.ApplicationContext appContext, String configFileLocation) constructor for initialising everything jda4spring if for whatever reason spring boot doesnt automatically initialise it, you can do so manually by creating a helper class and pass the ApplicationContext and the .config file location in here -
Method Summary
Modifier and TypeMethodDescriptionList<net.dv8tion.jda.api.JDA>getJDAInstances(Class<?> clazz) request the JDA instance for an eventListener
-
Constructor Details
-
JDA4SpringMain
public JDA4SpringMain(org.springframework.context.ApplicationContext appContext, @Value("${jda4spring.configFileLocation:src/main/resources/application.properties}") String configFileLocation) constructor for initialising everything jda4spring if for whatever reason spring boot doesnt automatically initialise it, you can do so manually by creating a helper class and pass the ApplicationContext and the .config file location in here- Parameters:
appContext- the spring boot application contextconfigFileLocation- a string to the location of the .config file
-
-
Method Details
-
getJDAInstances
request the JDA instance for an eventListener- Parameters:
clazz- the eventListener in need of his JDA- Returns:
- the correct JDA if available
-