Ali #11

Merged
alisolarflare merged 2 commits from Ali into master 2016-11-23 16:08:04 +00:00
2 changed files with 30 additions and 29 deletions
Showing only changes of commit 25e189e4d1 - Show all commits

View file

@ -1,28 +1,29 @@
package buttondevteam.discordplugin;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import buttondevteam.lib.TBMCDebugMessageEvent;
public class DebugMessageListener implements Listener{
@EventHandler
public void onException(TBMCDebugMessageEvent e) {
SendMessage(e.getDebugMessage());
e.setSent();
}
private static void SendMessage(String message) {
try {
StringBuilder sb = new StringBuilder();
sb.append("```").append("\n");
if (message.length() > 2000)
message = message.substring(0, 2000);
sb.append(message).append("\n");
sb.append("```");
DiscordPlugin.sendMessageToChannel(DiscordPlugin.debugchannel, sb.toString());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
package buttondevteam.discordplugin.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import buttondevteam.discordplugin.DiscordPlugin;
import buttondevteam.lib.TBMCDebugMessageEvent;
public class DebugMessageListener implements Listener{
@EventHandler
public void onException(TBMCDebugMessageEvent e) {
SendMessage(e.getDebugMessage());
e.setSent();
}
private static void SendMessage(String message) {
try {
StringBuilder sb = new StringBuilder();
sb.append("```").append("\n");
if (message.length() > 2000)
message = message.substring(0, 2000);
sb.append(message).append("\n");
sb.append("```");
DiscordPlugin.sendMessageToChannel(DiscordPlugin.botchannel, sb.toString());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}

View file

@ -24,7 +24,7 @@ public class ExceptionListener implements Listener {
stackTrace = stackTrace.substring(0, 2000);
sb.append(stackTrace).append("\n");
sb.append("```");
DiscordPlugin.sendMessageToChannel(DiscordPlugin.issuechannel, sb.toString());
DiscordPlugin.sendMessageToChannel(DiscordPlugin.botchannel, sb.toString());
} catch (Exception ex) {
ex.printStackTrace();
}