mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
Don't warn about unregistered channel-id based MessageType's
You shouldn't be registering these, there is no point for a user to configure where these go because it would be ignored.
This commit is contained in:
parent
e2cb7b2102
commit
f1d7e50dc0
1 changed files with 2 additions and 1 deletions
|
@ -31,6 +31,7 @@ import net.essentialsx.discord.listeners.DiscordCommandDispatcher;
|
|||
import net.essentialsx.discord.listeners.DiscordListener;
|
||||
import net.essentialsx.discord.util.ConsoleInjector;
|
||||
import net.essentialsx.discord.util.DiscordUtil;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
@ -224,7 +225,7 @@ public class JDADiscordService implements DiscordService {
|
|||
|
||||
@Override
|
||||
public void sendMessage(MessageType type, String message, boolean allowGroupMentions) {
|
||||
if (!registeredTypes.containsKey(type.getKey())) {
|
||||
if (!registeredTypes.containsKey(type.getKey()) && !NumberUtils.isDigits(type.getKey())) {
|
||||
logger.warning("Sending message to channel \"" + type.getKey() + "\" which is an unregistered type! If you are a plugin author, you should be registering your MessageType before using them.");
|
||||
}
|
||||
final DiscordMessageEvent event = new DiscordMessageEvent(type, FormatUtil.stripFormat(message), allowGroupMentions);
|
||||
|
|
Loading…
Reference in a new issue