use of com.github.vaerys.enums.ChannelSetting in project DiscordSailv2 by Vaerys-Dawn.
the class ChannelHere method execute.
@Override
public String execute(String args, CommandObject command) {
String desc = "";
if (!args.isEmpty()) {
for (ChannelSetting s : command.guild.channelSettings) {
if (args.equalsIgnoreCase(s.toString())) {
return s.toggleSetting(command.guild, command.channel.longID);
}
}
desc = "> Could not find channel type \"" + args + "\"\n";
}
XEmbedBuilder embedBuilder = new XEmbedBuilder(command);
String title = "> Here are all of the channel Types and Settings:";
List<ChannelSetting> channelSettings = command.guild.channelSettings;
List<String> types = channelSettings.stream().filter(channelSetting -> !channelSetting.isSetting()).map(ChannelSetting::toString).collect(Collectors.toList());
List<String> settings = channelSettings.stream().filter(channelSetting -> channelSetting.isSetting()).map(ChannelSetting::toString).collect(Collectors.toList());
Collections.sort(types);
desc += "**Types**\n```\n" + spacer + Utility.listFormatter(types, true) + "```\n" + spacer + "**Settings**\n```\n" + Utility.listFormatter(settings, true) + "```\n";
desc += "The Command **" + get(HelpChannel.class).getUsage(command) + "** Can give you extra information about each of the above.\n\n";
desc += missingArgs(command);
embedBuilder.withDesc(desc);
embedBuilder.withTitle(title);
RequestHandler.sendEmbedMessage("", embedBuilder, command.channel.get());
return null;
}
Aggregations