Added *temporary* solution to pinned messages

This commit is contained in:
Norbi Peti 2017-06-23 13:10:21 +02:00
parent 4f0c173a43
commit 329c2eeaa2

View file

@ -173,9 +173,15 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
Bukkit.dispatchCommand(dsender, cmd); Bukkit.dispatchCommand(dsender, cmd);
lastlistp = (short) Bukkit.getOnlinePlayers().size(); lastlistp = (short) Bukkit.getOnlinePlayers().size();
} else { } else {
TBMCChatAPI.SendChatMessage(Channel.GlobalChat, dsender, if (dmessage.length() == 0 && event.getMessage().getAttachments().size() == 0)
dmessage + (event.getMessage().getAttachments().size() > 0 ? "\n" + event.getMessage() TBMCChatAPI.SendChatMessage(Channel.GlobalChat, dsender, "pinned a message on Discord."); // TODO: Not chat message
.getAttachments().stream().map(a -> a.getUrl()).collect(Collectors.joining("\n")) else
TBMCChatAPI
.SendChatMessage(Channel.GlobalChat,
dsender, dmessage
+ (event.getMessage().getAttachments().size() > 0
? "\n" + event.getMessage().getAttachments().stream()
.map(a -> a.getUrl()).collect(Collectors.joining("\n"))
: "")); : ""));
event.getMessage().getChannel().getMessageHistory().stream().forEach(m -> { event.getMessage().getChannel().getMessageHistory().stream().forEach(m -> {
try { try {