diff --git a/build.gradle b/build.gradle index 3bb8af9..5d30a5f 100644 --- a/build.gradle +++ b/build.gradle @@ -67,7 +67,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter' installer('org.mangorage:installer:3.0.22') - bot('org.mangorage:mangobot:+') + bot('org.mangorage:mangobot:10.0.409') library('org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5') library('org.kohsuke:github-api:1.321') diff --git a/src/main/java/org/mangorage/mangobot/MangoBotPlugin.java b/src/main/java/org/mangorage/mangobot/MangoBotPlugin.java index 641bf66..8107a42 100644 --- a/src/main/java/org/mangorage/mangobot/MangoBotPlugin.java +++ b/src/main/java/org/mangorage/mangobot/MangoBotPlugin.java @@ -34,8 +34,6 @@ import java.util.EnumSet; import java.util.List; import java.util.Scanner; -import java.util.Timer; -import java.util.TimerTask; import net.dv8tion.jda.api.entities.channel.ChannelType; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; @@ -174,7 +172,7 @@ public MangoBotPlugin() { getJDA().addEventListener(new BotEventListener(this)); - getPluginBus().addGenericListener(100, MessageReceivedEvent.class, DiscordEvent.class, this::onMessage2); + getPluginBus().addGenericListener(10, MessageReceivedEvent.class, DiscordEvent.class, this::onMessage2); } public void onMessage2(DiscordEvent event) { @@ -289,7 +287,7 @@ public void registration() { }); new Listeners(this); - getPluginBus().addGenericListener(10, MessageReceivedEvent.class, DiscordEvent.class, this::onMessage); + getPluginBus().addGenericListener(10, MessageReceivedEvent.class, DiscordEvent.class, this::onMessage); } @Override diff --git a/src/main/java/org/mangorage/mangobot/core/BotEventListener.java b/src/main/java/org/mangorage/mangobot/core/BotEventListener.java index 22f2638..43346a6 100644 --- a/src/main/java/org/mangorage/mangobot/core/BotEventListener.java +++ b/src/main/java/org/mangorage/mangobot/core/BotEventListener.java @@ -36,11 +36,11 @@ import net.dv8tion.jda.api.events.session.SessionResumeEvent; import net.dv8tion.jda.api.hooks.SubscribeEvent; import org.mangorage.basicutils.LogHelper; +import org.mangorage.eventbus.interfaces.IEventBus; import org.mangorage.jdautils.WatcherManager; import org.mangorage.mangobotapi.core.events.DiscordEvent; import org.mangorage.mangobotapi.core.events.discord.DMessageReceivedEvent; import org.mangorage.mangobotapi.core.plugin.api.CorePlugin; -import org.mangorage.mboteventbus.impl.IEventBus; @SuppressWarnings("unused") diff --git a/src/main/java/org/mangorage/mangobot/modules/github/PasteRequestModule.java b/src/main/java/org/mangorage/mangobot/modules/github/PasteRequestModule.java index 1e4803a..7ad76ad 100644 --- a/src/main/java/org/mangorage/mangobot/modules/github/PasteRequestModule.java +++ b/src/main/java/org/mangorage/mangobot/modules/github/PasteRequestModule.java @@ -39,6 +39,7 @@ import org.eclipse.egit.github.core.service.GistService; import org.mangorage.basicutils.TaskScheduler; import org.mangorage.basicutils.misc.LazyReference; +import org.mangorage.eventbus.interfaces.IEventBus; import org.mangorage.mangobot.MangoBotPlugin; import org.mangorage.mangobot.modules.logs.BrokenDrivers; import org.mangorage.mangobot.modules.logs.EarlyWindow; @@ -46,8 +47,6 @@ import org.mangorage.mangobot.modules.logs.LogAnalyser; import org.mangorage.mangobot.modules.logs.MissingDeps; import org.mangorage.mangobotapi.core.events.DiscordEvent; -import org.mangorage.mboteventbus.impl.IEventBus; - import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.emoji.Emoji; diff --git a/src/test/java/org/mangorage/test/test.java b/src/test/java/org/mangorage/test/test.java new file mode 100644 index 0000000..d0f1d88 --- /dev/null +++ b/src/test/java/org/mangorage/test/test.java @@ -0,0 +1,17 @@ +package org.mangorage.test; + +import org.mangorage.eventbus.EventBus; +import org.mangorage.mangobotapi.core.events.SaveEvent; + +public class test { + public static void main(String[] args) { + var bus = EventBus.create(); + + bus.addListener(10, SaveEvent.class, test::onSave); + bus.post(new SaveEvent()); + } + + public static void onSave(SaveEvent e) { + System.out.println("LOL"); + } +}