treezz 0 Share Posted May 2, 2022 Hello, first time poster here, I'm trying to add discord integration to my osrs bot. I want to be able to control them via discord. But when I add either the Discord JDA package from here https://github.com/DV8FromTheWorld/JDA or the discord api package from here https://discord4j.com/ and set the discord bot to start inside the onStart() method the script fails to run. This is how I'm calling the discord bot to connect. @Override public void onStart() { log("Starting my lil bot"); initializeDiscord(); log("Discord bot started"); stopWatch.startTiming(); MouseSettings.setSpeed(4); SkillTracker.start(); } This is how I'm starting the discord bot: package com.company.discord; import discord4j.core.DiscordClient; import discord4j.core.GatewayDiscordClient; import reactor.core.publisher.Mono; public class DiscBot { public DiscBot() { DiscordClient client = DiscordClient.create("token here"); Mono<Void> login = client.withGateway((GatewayDiscordClient gateway) -> Mono.empty()); login.block(); } } but when I run this I get this error output: 8:01:59 PM: [ERROR] The script had a problem starting: java.lang.NoClassDefFoundError: org/reactivestreams/Publisher at com.company.Main.initializeDiscord(Main.java:71) at com.company.Main.onStart(Main.java:81) at org.dreambot.api.script.AbstractScript.run(AbstractScript.java) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.ClassNotFoundException: org.reactivestreams.Publisher at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 4 more Has anyone been able to connect a dreambot script to discord? Could anyone help with this or have any code snippits I can look at? PS. when I remove the discord line the bot works fine. Thanks!!!! Link to comment Share on other sites More sharing options...
Pandemic 2702 Share Posted May 2, 2022 Hey there, it looks like you aren't including the dependencies into your final script jar. You mostly likely need to set up your IDE to include those dependencies, or use a build system like Maven/gradle to do that for you Xtra 1 Link to comment Share on other sites More sharing options...
treezz 0 Author Share Posted May 8, 2022 Hey thanks for the reply! So I thought I was adding the dependencies to the jar file when I move them under the bot.jar side like I have them here: This looks like the discord package will be added to the jar. But I'm not sure what else I need to do. Does this look correct? I'm not using Maven but I did create a maven project to see if that would work but I was having some other issues with that one. PS. sorry for the late reply, I got COVID on tuesday and was super sick all week. Link to comment Share on other sites More sharing options...
treezz 0 Author Share Posted May 8, 2022 Nevermind!! I just found this tutorial lol https://dreambot.org/guides/scripter-guide/script-dev/maven/#build-plugin-for-uberfatshaded-jars Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now