mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Don't throw exceptions when DSRV channels are misconfigured
This commit is contained in:
1 parent
e4adb0752a
commit
82c22a08fa
1 file changed
+7
-1
@@ -102,7 +102,13 @@ public final class DSRVChatHook implements ChatHook {
|
||||
@Override
|
||||
public void broadcastMessageToChannel(final String channel, final github.scarsz.discordsrv.dependencies.kyori.adventure.text.Component message) {
|
||||
final String mmFormattedMessage = MiniMessage.miniMessage().serialize(message);
|
||||
ChannelUtils.broadcastMessageToChannel(mmFormattedMessage, this.channelRegistry.byCommandName(channel));
|
||||
final ChatChannel chatChannel = this.channelRegistry.byCommandName(channel);
|
||||
|
||||
if (chatChannel == null) {
|
||||
this.plugin.getLogger().warning("Error sending message from Discord to Minecraft, no matching channel found for [" + channel + "]");
|
||||
} else {
|
||||
ChannelUtils.broadcastMessageToChannel(mmFormattedMessage, chatChannel);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user