Change help for NSFW command

This commit is contained in:
BrokenFire 2018-02-27 15:38:12 +01:00
parent 3183794599
commit 9e73cf016d

View File

@ -117,9 +117,12 @@ public class Help implements Commande {
else else
{ {
TableRenderer table = new TableRenderer(); TableRenderer table = new TableRenderer();
List<String> noPu = new ArrayList<>();
table.setHeader("Command","PU"); table.setHeader("Command","PU");
TableRenderer nsfwTable = new TableRenderer();
nsfwTable.setHeader("NSFW Only\u00A0", "PU");
List<String> noPu = new ArrayList<>();
boolean isAdmin; boolean isAdmin;
if(event.isFromType(ChannelType.PRIVATE)) if(event.isFromType(ChannelType.PRIVATE))
isAdmin = event.getJDA().getGuilds().get(0).getMember(event.getAuthor()).hasPermission(Permission.ADMINISTRATOR); isAdmin = event.getJDA().getGuilds().get(0).getMember(event.getAuthor()).hasPermission(Permission.ADMINISTRATOR);
@ -131,6 +134,8 @@ public class Help implements Commande {
if(!e.getValue().isAdminCmd() || isAdmin){ if(!e.getValue().isAdminCmd() || isAdmin){
if(e.getValue().isPrivateUsable()) if(e.getValue().isPrivateUsable())
table.addRow(e.getKey(), "XX"); table.addRow(e.getKey(), "XX");
else if(e.getValue().isNSFW())
nsfwTable.addRow(e.getKey(),"");
else else
noPu.add(e.getKey()); noPu.add(e.getKey());
} }
@ -142,6 +147,8 @@ public class Help implements Commande {
table.addRow(key, ""); table.addRow(key, "");
String txt = table.build(); String txt = table.build();
txt += "\n\n";
txt += nsfwTable.build();
if(!event.isFromType(ChannelType.PRIVATE)){ if(!event.isFromType(ChannelType.PRIVATE)){
Message rest = event.getTextChannel().sendMessage(new EmbedBuilder().setTitle("Command envoyées par message privé").setColor(Color.green).build()).complete(); Message rest = event.getTextChannel().sendMessage(new EmbedBuilder().setTitle("Command envoyées par message privé").setColor(Color.green).build()).complete();