DiscordSRV sends messages to the game chat from all channels specified in the config.
Opened this issue ยท 1 comments
I am using the DiscordSRV API for my plugin to display some information from the game to the Discord channel. The problem is that DiscordSRV starts listening to all channels that are specified in the config and sends messages from them to the game chat.
But I don't want him to listen to these channels and send messages from them to the game chat. For example, I added two channels - test1 and test2, and if someone writes messages to these channels, they will be redirected to the game chat. How can I avoid this?
Channels: {"global": "749716592132227133", "test1": "805406663308738580", "test2": "791292995260907547"}
At the moment, I solved this problem like this:
@Subscribe
public void discordMessageProcessed(DiscordGuildMessagePostProcessEvent event) {
if (event.getChannel().getId().equals(DiscordSRV.getPlugin().getDestinationTextChannelForGameChannelName("test1").getId())) {
event.setCancelled(true);
}
}
But I'm not sure if this is correct. Is there a more correct way to solve this problem?