1.14.4 JDA Spigot

Discussion in 'Spigot Plugin Development' started by Ardno, Feb 14, 2020.

  1. Hello,
    I'm making a spigot-discord chat, but if I use JDA-withDependecies and I paste it to plugins folder, my plugin don't register the JDA so the discord bot(which plugin can contorl) don't start. How I can use JDA in spigot?
     
  2. You should use JDA as a dependency of your plugin, you cannot use it directly by just pasting it into your plugin folder!
     
  3. And where I should place the JDA, if I add JDA plugin to depend of my plugin?
     
  4. you load it like a standard plugin... have a main class extending JavaPlugin, create your bot in your onEnable
     
  5. Shade JDA using Maven.
    Or ShadowJar for Gradle.

    You would build a bot like you usually do during onEnable instead of the main method.
     
  6. I have a JDA-4.1.1_108-withDependencies.jar file. How I can this start as normal plugin?
     
  7. I don't think you can, you could try just throwing it in your plugins folder but not sure if that will work. If it doesn't read what I said above:
     
  8. I don't want to use Maven, but if it last possibility I do that.
     
  9. its your only possibility. you cant just load something out of the blue. that isnt how it works. you need to create a plugin that the server will load, and then use your plugin to load the bot. the classes need to be available at runtime, and the only way to do that is to shade in some form or fashion. unless the native ide compiler allows you to include classes from a library/dependency to be available at runtime.
     
    • Agree Agree x 1
  10. Creative (not suggested) idea:

    Compile a main class, move it to the JDA jar, and add a plugin.yml. Not suggested but you don't have to shade it into your plugin, you can just use it as a dependency. I've tried it and it worked.
     
    • Winner Winner x 1