Skip to content

Commit

Permalink
fixaros
Browse files Browse the repository at this point in the history
  • Loading branch information
HMJosh committed Feb 9, 2021
1 parent f08a080 commit e401cd1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.Joshb</groupId>
<artifactId>DiscordBotAPI</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>

<build>
<sourceDirectory>src/main/java</sourceDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import me.joshb.discordbotapi.Permission;
import me.joshb.discordbotapi.bungee.DiscordBotAPI;
import me.joshb.discordbotapi.bungee.assets.Assets;
import me.joshb.discordbotapi.bungee.config.Config;
import net.dv8tion.jda.api.entities.User;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
Expand All @@ -19,8 +20,10 @@ public class CommandManager extends Command {
private List<DiscordCommand> commands = new ArrayList<>();

public void initializeSubCommands(){
commands.add(new CommandLink());
commands.add(new CommandUnlink());
if(Config.getInstance().getConfig().getBoolean("Account-Manager")) {
commands.add(new CommandLink());
commands.add(new CommandUnlink());
}
}

public void execute(CommandSender sender, String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public void initialize(){
} catch (IOException e){
e.printStackTrace();
}
if(!config.contains("Account-Manager")){
config.set("Account-Manager", true);
save();
}
}
public void save() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import me.joshb.discordbotapi.server.DiscordBotAPI;
import me.joshb.discordbotapi.server.assets.Assets;
import me.joshb.discordbotapi.Permission;
import me.joshb.discordbotapi.server.config.Config;
import net.dv8tion.jda.api.entities.User;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand All @@ -18,8 +19,10 @@ public class CommandManager implements CommandExecutor {
private List<DiscordCommand> commands = new ArrayList<>();

public void initializeSubCommands(){
commands.add(new CommandLink());
commands.add(new CommandUnlink());
if(Config.getInstance().getConfig().getBoolean("Account-Manager")){
commands.add(new CommandLink());
commands.add(new CommandUnlink());
}
}

@Override
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/Config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Bot:
Token: "token_here"
Command-Prefix: "!ticketgui"
Command-Prefix: "!ticketgui"
#Enabling/Disabling this setting will determine if /dm link and /dm unlink commands will be registered.
Account-Manager: true

0 comments on commit e401cd1

Please sign in to comment.