Skip to content

Commit

Permalink
fixed rulecode being visible
Browse files Browse the repository at this point in the history
* fixed a bug that would allow users to see the Rulecode value in the
GetGuildInfo command output
  • Loading branch information
Vaerys-Dawn committed Mar 18, 2018
1 parent cc12e0b commit 26787cb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import com.github.vaerys.commands.admin.SetRuleCodeReward;
import com.github.vaerys.commands.general.RulesCode;
import com.github.vaerys.enums.SAILType;
import com.github.vaerys.handlers.GuildHandler;
import com.github.vaerys.pogos.GuildConfig;
import com.github.vaerys.templates.GuildModule;
import sx.blah.discord.handle.obj.IRole;
import sx.blah.discord.handle.obj.Permissions;

public class ModuleRuleRewards extends GuildModule {

Expand Down Expand Up @@ -55,16 +57,19 @@ public void setup() {

@Override
public String stats(CommandObject object) {
String response = "";
if (object.guild.config.getRuleCode() != null) {
response += "**Rule Code:** " + object.guild.config.getRuleCode();
if (GuildHandler.testForPerms(object, Permissions.MANAGE_SERVER)) {
String response = "";
if (object.guild.config.getRuleCode() != null) {
response += "**Rule Code:** " + object.guild.config.getRuleCode();
}
IRole reward = object.guild.getRoleByID(object.guild.config.ruleCodeRewardID);
if (reward != null) {
if (!response.isEmpty()) response += "\n";
response += "**Reward Role:** " + reward.getName();
}
if (response.isEmpty()) return null;
return response;
}
IRole reward = object.guild.getRoleByID(object.guild.config.ruleCodeRewardID);
if (reward != null) {
if (!response.isEmpty()) response += "\n";
response += "**Reward Role:** " + reward.getName();
}
if (response.isEmpty()) return null;
return response;
return null;
}
}
Binary file modified target/JavaDiscordSAILv2.jar
Binary file not shown.

0 comments on commit 26787cb

Please sign in to comment.