Skip to content

Commit

Permalink
remove custom link listener, removing discordsrv's link listener and …
Browse files Browse the repository at this point in the history
…custom link channel because they are useless now
  • Loading branch information
BlueTree242 committed Sep 20, 2022
1 parent 541ae36 commit e133adb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.bukkit.plugin.java.JavaPlugin;
import tk.bluetree242.discordsrvutils.DiscordSRVUtils;
import tk.bluetree242.discordsrvutils.bukkit.discordsrv.SlashCommandProvider;
import tk.bluetree242.discordsrvutils.bukkit.listeners.jda.CustomDiscordAccountLinkListener;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -92,7 +91,6 @@ public void onLoad() {
if (getServer().getPluginManager().getPlugin("DiscordSRV") != null) {
core = new DiscordSRVUtils(new BukkitPlugin(this));
((BukkitPlugin) core.getPlatform()).setDiscordSRVUtils(core);
core.getJdaManager().getListeners().add(new CustomDiscordAccountLinkListener(core));
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ public class DiscordSRVUtils {
private LevelingConfig levelingConfig;
//was the DiscordSRV AccountLink Listener Removed?
@Getter
private boolean removedDiscordSRVAccountLinkListener = false;
@Getter
private SuggestionsConfig suggestionsConfig;
private ConfManager<SQLConfig> sqlconfigmanager;
@Getter
Expand Down Expand Up @@ -303,15 +301,6 @@ public void whenReady() {
registerListeners();
setSettings(true);
pluginHookManager.hookAll();
//remove the discordsrv LinkAccount listener via reflections
if (getMainConfig().remove_discordsrv_link_listener()) {
for (Object listener : getJDA().getEventManager().getRegisteredListeners()) {
if (listener.getClass().getName().equals("github.scarsz.discordsrv.listeners.DiscordAccountLinkListener")) {
getJDA().removeEventListener(listener);
removedDiscordSRVAccountLinkListener = true;
}
}
}
if (!inviteTrackingManager.cacheInvites())
errorHandler.severe("Bot does not have the MANAGE_SERVER permission, we cannot make detect inviter when someone joins, please grant the permission.");
//fix issues with any ticket or panel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,6 @@ public interface Config {
@ConfDefault.DefaultString("ONLINE")
String onlinestatus();

@AnnotationBasedSorter.Order(31)
@ConfKey("remove-discordsrv-link-listener")
@ConfComments("#Should we remove DiscordSRV's account link listener?? bot won't respond to dm link codes\n#NOTE: Plugin uses reflection to do this. Which is like hacking into DiscordSRV")
@ConfDefault.DefaultBoolean(false)
boolean remove_discordsrv_link_listener();

@AnnotationBasedSorter.Order(32)
@ConfKey("linkaccount-channel")
@ConfComments("#Custom LinkAccount Channel. ")
@ConfDefault.DefaultLong(0)
long linkaccount_channel();

@AnnotationBasedSorter.Order(33)
@ConfKey("linkaccount-channel-delete-messages-delay")
@ConfComments("#Amount of time in seconds to delete messages sent in the link account channel, set 0 to not delete at all")
@ConfDefault.DefaultLong(10)
long linkaccount_channel_delete_messages_delay();

@AnnotationBasedSorter.Order(34)
@ConfKey("disabled-commands")
@ConfComments("# Commands that must be disabled, will also hide from help command, Don't use aliases here")
Expand Down

0 comments on commit e133adb

Please sign in to comment.