Skip to content

Commit

Permalink
Merge pull request #20 from FA22B/DBOT-54-Plugin-Konfiguration
Browse files Browse the repository at this point in the history
Use correct Component for checking whether plugins are enabled.
  • Loading branch information
eawd123wadd4354as243df authored May 30, 2024
2 parents 763062b + 09077cc commit d81aff6
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 d81aff6

Please sign in to comment.