CONTINUE WORK LATER!!!
This commit is contained in:
parent
4dd6b05bd0
commit
29dd178715
3 changed files with 25 additions and 9 deletions
|
|
@ -7,6 +7,7 @@ import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
import net.dv8tion.jda.api.Permission;
|
import net.dv8tion.jda.api.Permission;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -56,15 +57,31 @@ public class HelpCommand implements Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class HelpInfo {
|
||||||
|
private String[] labels;
|
||||||
|
private String description;
|
||||||
|
private String usage;
|
||||||
|
private String example;
|
||||||
|
|
||||||
|
public HelpInfo(String[] labels, String description, String usage, String example) {
|
||||||
|
this.labels = labels;
|
||||||
|
this.description = description;
|
||||||
|
this.usage = usage;
|
||||||
|
this.example = example;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void sendHelp(Command cmd, CommandEvent event) {
|
public void sendHelp(Command cmd, CommandEvent event) {
|
||||||
if (!cmd.getClass().getPackageName().endsWith("owner") || (cmd.getClass().getPackageName().endsWith("owner") &&
|
if (!cmd.getClass().getPackageName().endsWith("owner") || (cmd.getClass().getPackageName().endsWith("owner") &&
|
||||||
(event.getAuthor().getId().equals("477141528981012511") || event.getAuthor().getId().equals("261083609148948488")))) {
|
(event.getAuthor().getId().equals("477141528981012511") || event.getAuthor().getId().equals("261083609148948488")))) {
|
||||||
String name = cmd.labels()[0];
|
String name = labels()[0];
|
||||||
event.getChannel().sendMessage(event.getMessageEditor().getMessage(
|
event.getChannel().sendMessage(event.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.INFO, "", cmd.description())
|
MessageEditor.MessageType.INFO)
|
||||||
.setTitle(name.replaceFirst(String.valueOf(name.charAt(0)), String.valueOf(name.charAt(0)).toUpperCase()))
|
.setTitle(name.replaceFirst(String.valueOf(name.charAt(0)), String.valueOf(name.charAt(0)).toUpperCase()))
|
||||||
.addField(MessageEditor.getTerm(event, "commands.general.help.field.usage", "", ""),
|
.setDescription(
|
||||||
event.getRethink().getUserPrefix(event.getAuthor().getId()) + cmd.labels()[0] + " " + event.getMessageEditor().getTerm(cmd.usage()), false)
|
event.getMessageEditor().getTerm("commands.general.help.description") + cmd.description() + "\n" +
|
||||||
|
event.getMessageEditor().getTerm("commands.general.help.usage") + event.getRethink().getGuildPrefix(event.getGuild().getId()) + name + " " + cmd.usage() + "\n" +
|
||||||
|
event.getMessageEditor().getTerm("commands.general.help.example") + event.getRethink().getGuildPrefix(event.getGuild().getId()) + name + "")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,10 +113,7 @@ public class MessageEditor {
|
||||||
return this.handle(rethink.getLanguage(user.getId()), string, extra, extra_two);
|
return this.handle(rethink.getLanguage(user.getId()), string, extra, extra_two);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTerm(CommandEvent event, String string, String extra, String extra_two) {
|
|
||||||
return new MessageEditor(null, null)
|
|
||||||
.handle(event.getRethink().getLanguage(event.getAuthor().getId()), string, extra, extra_two);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String handle(String language_code, String string, String extra, String extra_two) {
|
private String handle(String language_code, String string, String extra, String extra_two) {
|
||||||
Locale locale = new Locale(language_code);
|
Locale locale = new Locale(language_code);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ commands.general.equals.string.first = First string\:
|
||||||
commands.general.equals.string.second = Second string\:
|
commands.general.equals.string.second = Second string\:
|
||||||
commands.general.equals.string.result = Result\:
|
commands.general.equals.string.result = Result\:
|
||||||
commands.general.equals.help.description = Checks if two strings are the same.
|
commands.general.equals.help.description = Checks if two strings are the same.
|
||||||
commands.general.help.field.usage = Usage\:
|
commands.general.help.description = **Description: **
|
||||||
|
commands.general.help.usage = **Usage\: **
|
||||||
|
commands.general.help.example = **Example: **
|
||||||
commands.general.help.error.description = I need the Embed Links Permission to send the Help Menu\!
|
commands.general.help.error.description = I need the Embed Links Permission to send the Help Menu\!
|
||||||
commands.general.help.help.description = Shows each command and explains its usage.
|
commands.general.help.help.description = Shows each command and explains its usage.
|
||||||
commands.general.help.help.label = [CommandName]
|
commands.general.help.help.label = [CommandName]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue