Add embeds footer text to custom translations. #3

Merge aplicado
RealRTTV mesclou 26 commits from master into development 2021-11-14 04:35:26 +00:00
2 arquivos alterados com 19 adições e 3 exclusões
Mostrando apenas as alterações do commit bfbb1dccf8 - Mostrar todos os commits

Fix help command.

Set a minimum allowed value to whitelistScheduledVerificationSeconds.
Luna Fox 2021-03-19 07:53:57 -03:00

Ver arquivo

@ -46,7 +46,19 @@ public class Config {
configData = AutoWhitelist.GSON.fromJson(stringReader, ConfigData.class);
if (configData.whitelistScheduledVerificationSeconds < 30) {
if (configData.whitelistScheduledVerificationSeconds <= 0) {
configData.whitelistScheduledVerificationSeconds = 30;
AutoWhitelist.LOGGER.warn("Whitelist scheduled verification time can't be equals to or lower than 0. It has been set to 30 (not on the file)");
try {
AutoWhitelist.server.getCommandSource().sendFeedback(new LiteralText("Whitelist scheduled verification time can't be equals to or lower than 0. It has been set to 30 (not on the file)"), true);
} catch (NullPointerException ignored) {}
} else if (configData.whitelistScheduledVerificationSeconds < 3) {
configData.whitelistScheduledVerificationSeconds = 30;
AutoWhitelist.LOGGER.warn("Whitelist scheduled verification time have to be at least 3 seconds. It has been set to 30 (not on the file)");
try {
AutoWhitelist.server.getCommandSource().sendFeedback(new LiteralText("Whitelist scheduled verification time have to be at least 3 seconds. It has been set to 30 (not on the file)"), true);
} catch (NullPointerException ignored) {}
} else if (configData.whitelistScheduledVerificationSeconds < 30) {
AutoWhitelist.LOGGER.warn("Whitelist scheduled verification time is really low. It is not recommended to have it lower than 30 seconds, since it can affect the server performance.");
try {
AutoWhitelist.server.getCommandSource().sendFeedback(new LiteralText("Whitelist scheduled verification time is really low. It is not recommended to have it lower than 30 seconds, since it can affect the server performance."), true);

Ver arquivo

@ -15,6 +15,7 @@ import com.jagrosh.jdautilities.command.Command;
import com.jagrosh.jdautilities.command.CommandClient;
import com.jagrosh.jdautilities.command.CommandClientBuilder;
import com.jagrosh.jdautilities.command.CommandEvent;
import com.jagrosh.jdautilities.examples.command.PingCommand;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.ReadyEvent;
@ -49,6 +50,7 @@ public class BotEventListener extends ListenerAdapter {
builder.setHelpConsumer(generateHelpConsumer());
builder.addCommands(
new RegisterCommand(),
new PingCommand(),
//Developer commands
new ServerStatusCommand(),
@ -76,7 +78,7 @@ public class BotEventListener extends ListenerAdapter {
Command.Category category;
List<MessageEmbed.Field> fields = new ArrayList<>();
for (Command command : event.getClient().getCommands()) {
if (!command.isHidden() && (!command.isOwnerCommand() || event.isOwner())) {
if ((!command.isHidden() && !command.isOwnerCommand()) || event.isOwner()) {
String command_ = "\n`" +
event.getClient().getPrefix() +
@ -104,9 +106,11 @@ public class BotEventListener extends ListenerAdapter {
commands = "";
commands += "\n" + field.getValue();
lastName = field.getName();
} else {
} else if (fields.size() > 1) {
commands += field.getValue();
lastName = field.getName();
} else {
mergedFields.add(new MessageEmbed.Field(field.getName(), field.getValue(), false));
}
}