Skip to content

Commit

Permalink
Use correct Component for checking whether plugins are enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sieweke committed May 30, 2024
1 parent 7196c02 commit 09077cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/bothq/lib/plugin/IPlugin.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.bothq.lib.plugin;

import com.bothq.lib.plugin.config.IConfig;
import com.bothq.lib.plugin.config.component.ICheckBox;
import com.bothq.lib.plugin.config.enabled.IEnabled;
import net.dv8tion.jda.api.JDA;

/**
Expand All @@ -10,11 +10,11 @@
* Constructor must be public accessible, without any parameters.
*/
public interface IPlugin {
ICheckBox getEnabledCheckbox();
IEnabled getEnabled();
default boolean isEnabled(long serverId) {
return getEnabledCheckbox()
return getEnabled()
.get(serverId)
.getValue();
.isEnabled();
}


Expand Down

0 comments on commit 09077cc

Please sign in to comment.