Checking for attachments

This commit is contained in:
Norbi Peti 2016-11-14 19:26:37 +01:00
parent 3066271c0e
commit 6ef6882335

View file

@ -1,5 +1,7 @@
package buttondevteam.discordplugin;
import java.util.stream.Collectors;
import org.bukkit.Bukkit;
import buttondevteam.discordplugin.commands.DiscordCommandBase;
@ -25,6 +27,10 @@ public class CommandListener {
}, new IListener<MessageReceivedEvent>() {
@Override
public void handle(MessageReceivedEvent event) {
if (event.getMessage().getChannel().getID().equals("219626707458457603"))
Bukkit.getLogger().info("Attachment in dev: " + event.getMessage().getAttachments().stream().map(
a -> a.getFilename() + " - " + a.getFilesize() + " - " + a.getId() + " - " + a.getUrl())
.collect(Collectors.joining(", ")));
if (!event.getMessage().getChannel().isPrivate())
return;
if (event.getMessage().getAuthor().isBot())