Added message for testing

This commit is contained in:
Norbi Peti 2016-11-25 21:35:21 +01:00
parent 20d6cd7313
commit 7de50eb00d
2 changed files with 4 additions and 1 deletions

View file

@ -207,7 +207,8 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
e.printStackTrace();
}
try {
return channel.sendMessage(message);
return channel
.sendMessage(Test ? "*The following message is from a test server*\n" + message : message);
} catch (Exception e) {
if (i == 9) {
Bukkit.getLogger().warning("Failed to deliver message to Discord! Channel: " + channel.getName()

View file

@ -20,6 +20,8 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
@Override
public void handle(MessageReceivedEvent event) {
if (event.getMessage().getAuthor().isBot())
return;
if (event.getMessage().getChannel().getID().equals(DiscordPlugin.chatchannel.getID()))
TBMCChatAPI.SendChatMessage(Channel.GlobalChat, Bukkit.getConsoleSender(), event.getMessage().getContent());
}