Class JDA4SpringMain

java.lang.Object
xyz.norbjert.jda4spring.internal.JDA4SpringMain

@Component public class JDA4SpringMain extends Object
handles the initialisation process of the individual DiscordBots and configures them with their tasks, activities and API tokens (and soon gateway intents)
  • Constructor Summary

    Constructors
    Constructor
    Description
    JDA4SpringMain(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 Type
    Method
    Description
    List<net.dv8tion.jda.api.JDA>
    request the JDA instance for an eventListener

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 context
      configFileLocation - a string to the location of the .config file
  • Method Details

    • getJDAInstances

      public List<net.dv8tion.jda.api.JDA> getJDAInstances(Class<?> clazz)
      request the JDA instance for an eventListener
      Parameters:
      clazz - the eventListener in need of his JDA
      Returns:
      the correct JDA if available