mirror of
https://github.com/cnaude/PurpleIRC-spigot.git
synced 2024-11-05 18:09:37 +01:00
Add @ mention support for DiscordSRV hook
This commit is contained in:
parent
83d85bb7a7
commit
7794d2898d
@ -48,15 +48,16 @@ public class DiscordSRVHook {
|
||||
public void sendMessage(String channelName, String message) {
|
||||
TextChannel textChannel = DiscordSRV.getPlugin().getDestinationTextChannelForGameChannelName(channelName);
|
||||
TextChannel chatChannel = DiscordSRV.getPlugin().getMainTextChannel();
|
||||
String discordMessage = DiscordUtil.convertMentionsFromNames(message, DiscordSRV.getPlugin().getMainGuild());
|
||||
plugin.logDebug("DiscordSRVHook: Message to be sent: " + message);
|
||||
if (textChannel != null) {
|
||||
plugin.logDebug("DiscordSRVHook: Sending message to channel " + channelName);
|
||||
DiscordUtil.sendMessage(textChannel, message);
|
||||
DiscordUtil.sendMessage(textChannel, discordMessage);
|
||||
} else {
|
||||
plugin.logDebug("DiscordSRVHook: Unable to find channel: " + channelName);
|
||||
plugin.logDebug("DiscordSRVHook: Channel list: " + DiscordSRV.getPlugin().getChannels().keySet());
|
||||
plugin.logDebug("DiscordSRVHook: Sending message to ChatChannel instead: " + chatChannel.getName());
|
||||
DiscordUtil.sendMessage(chatChannel, message);
|
||||
DiscordUtil.sendMessage(chatChannel, discordMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user