本文整理汇总了Java中com.jagrosh.jdautilities.commandclient.Command.getArguments方法的典型用法代码示例。如果您正苦于以下问题:Java Command.getArguments方法的具体用法?Java Command.getArguments怎么用?Java Command.getArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jagrosh.jdautilities.commandclient.Command
的用法示例。
在下文中一共展示了Command.getArguments方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHelpCard
import com.jagrosh.jdautilities.commandclient.Command; //导入方法依赖的package包/类
protected static MessageEmbed getHelpCard(CommandEvent e, Command c) {
EmbedBuilder eb = new EmbedBuilder().setColor(e.getGuild().getMember(e.getJDA().getSelfUser()).getColor());
eb.setTitle(c.getName().substring(0, 1).toUpperCase() + c.getName().substring(1) + " Command Help Card:", null);
String argument = c.getArguments() == null ? "" : c.getArguments();
eb.addField("Usage", e.getClient().getPrefix() + c.getName() + " " + argument, false);
eb.addField("Description", c.getHelp(), false);
String r;
if (c.getAliases().length == 0)
r = Locale.getCommandMessage("no-alias").finish();
else
r = Arrays.toString(c.getAliases()).replaceAll("\\[", "").replaceAll("]", "");
eb.addField("Alias", r, false);
String permission = c.getUserPermissions().length < 1 ? "None" : Arrays.toString(c.getUserPermissions());
if (c.isOwnerCommand())
permission = "OWNER";
if (c.getCategory().equals(Bot.ADMIN))
permission = "ADMIN";
eb.addField("Permission", "Required Permission: " + permission, false);
return eb.build();
}
示例2: appendCommand
import com.jagrosh.jdautilities.commandclient.Command; //导入方法依赖的package包/类
private void appendCommand(StringBuilder sb, String prefix, Command command)
{
sb.append("`").append(prefix).append(command.getName());
if(command.getArguments() != null && !command.getArguments().isEmpty())
sb.append(" ").append(command.getArguments());
sb.append("`");
if(command.getHelp() != null && !command.getHelp().isEmpty())
sb.append(" - ").append(command.getHelp());
sb.append("\n");
}