Added sending attachment URLs to MC (#12)

This commit is contained in:
Norbi Peti 2016-12-01 21:34:54 +01:00
parent 86009a0677
commit 97c568a662

View file

@ -1,6 +1,7 @@
package buttondevteam.discordplugin.listeners; package buttondevteam.discordplugin.listeners;
import java.util.Arrays; import java.util.Arrays;
import java.util.stream.Collectors;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -56,6 +57,9 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
return; return;
} }
} else } else
TBMCChatAPI.SendChatMessage(Channel.GlobalChat, dsender, event.getMessage().getContent()); TBMCChatAPI.SendChatMessage(Channel.GlobalChat, dsender,
event.getMessage().getContent()
+ (event.getMessage().getAttachments().size() > 0 ? event.getMessage().getAttachments()
.stream().map(a -> a.getUrl()).collect(Collectors.joining("\n")) : ""));
} }
} }