Add some additional debugging to figure out issue #26.

Update pom for DiscordSRV 12.3.
This commit is contained in:
cnaude 2016-12-17 22:26:41 -07:00
parent a6d09352bf
commit 419a52621d
4 changed files with 10 additions and 6 deletions

View File

@ -420,7 +420,7 @@
<dependency>
<groupId>com.scarsz.discordsrv</groupId>
<artifactId>DiscordSRV</artifactId>
<version>11.0</version>
<version>12.3</version>
<scope>provided</scope>
</dependency>

View File

@ -48,11 +48,15 @@ public class DiscordSRVHook {
public void sendMessage(String channelName, String message) {
TextChannel textChannel = DiscordSRV.getTextChannelFromChannelName(channelName);
TextChannel chatChannel = DiscordSRV.chatChannel;
plugin.logDebug("DiscordSRVHook: Message to be sent: " + message);
if (textChannel != null) {
plugin.logDebug("DiscordSRVHook[" + channelName + "]: " + message);
plugin.logDebug("DiscordSRVHook: Sending mssage to channel " + channelName);
textChannel.sendMessage(message);
} else {
plugin.logDebug("DiscordSRVHook: " + message);
plugin.logDebug("DiscordSRVHook: Unable to find channel: " + channelName);
plugin.logDebug("DiscordSRVHook: Channel list: " + DiscordSRV.channels.keySet());
plugin.logDebug("DiscordSRVHook: Sending message to ChatChannel instead: " + chatChannel.getName());
DiscordSRV.sendMessageToChatChannel(message);
}

View File

@ -1561,10 +1561,10 @@ public final class PurpleBot {
return;
}
for (String channelName : botChannels) {
if (isMessageEnabled(channelName, TemplateName.GAME_DISCORD_CHAT)) {
if (isMessageEnabled(channelName, TemplateName.DISCORD_CHAT)) {
asyncIRCMessage(channelName, plugin.tokenizer
.gameChatToIRCTokenizer(username, plugin.getMessageTemplate(
botNick, channelName, TemplateName.GAME_DISCORD_CHAT), message)
botNick, channelName, TemplateName.DISCORD_CHAT), message)
.replace("%CHANNEL%", channelId)
);
}

View File

@ -149,7 +149,7 @@ public class TemplateName {
public final static String GAME_ADMIN_CHAT = "game-a-chat";
public final static String IRC_ADMIN_CHAT = "irc-a-chat";
public final static String GAME_DISCORD_CHAT = "discord-chat";
public final static String DISCORD_CHAT = "discord-chat";
public final static String IRC_DISCORD_CHAT = "irc-discord-chat";
public final static String FAKE_JOIN = "fake-join";