mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Add option to log channels to console
This commit is contained in:
parent
12cc0b99f9
commit
db027bced3
@ -121,6 +121,10 @@ public class DiscordSettings implements IConf {
|
||||
return config.getBoolean("chat.show-all-chat", false);
|
||||
}
|
||||
|
||||
public List<String> getRelayToConsoleList() {
|
||||
return config.getList("chat.relay-to-console", String.class);
|
||||
}
|
||||
|
||||
public String getConsoleChannelDef() {
|
||||
return config.getString("console.channel", "none");
|
||||
}
|
||||
|
@ -88,12 +88,20 @@ public class DiscordListener extends ListenerAdapter {
|
||||
event.getChannel().getName(), user.getName(), user.getDiscriminator(), user.getAsTag(),
|
||||
member.getEffectiveName(), DiscordUtil.getRoleColorFormat(member), finalMessage, DiscordUtil.getRoleFormat(member)), EmojiParser.FitzpatrickAction.REMOVE);
|
||||
|
||||
for (final String group : keys) {
|
||||
if (plugin.getSettings().getRelayToConsoleList().contains(group)) {
|
||||
logger.info(formattedMessage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (IUser essUser : plugin.getPlugin().getEss().getOnlineUsers()) {
|
||||
for (String group : keys) {
|
||||
final String perm = "essentials.discord.receive." + group;
|
||||
final boolean primaryOverride = plugin.getSettings().isAlwaysReceivePrimary() && group.equalsIgnoreCase("primary");
|
||||
if (primaryOverride || (essUser.isPermissionSet(perm) && essUser.isAuthorized(perm))) {
|
||||
essUser.sendMessage(formattedMessage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +61,11 @@ chat:
|
||||
# Whether or not to show all Minecraft chat messages that are not shown to all players.
|
||||
# You shouldn't need to enable this unless you're not seeing all chat messages go through to Discord.
|
||||
show-all-chat: false
|
||||
# A list of Discord channels which should be logged to console.
|
||||
# If you want to use the channels below, remember to uncomment the line by removing the '#' before the '-'.
|
||||
relay-to-console:
|
||||
#- primary
|
||||
#- chat
|
||||
|
||||
# Console relay settings
|
||||
# The console relay sends every message shown in the console to a Discord channel.
|
||||
|
Loading…
Reference in New Issue
Block a user