import java.util.Set;
import net.pterodactylus.irc.DccReceiver;
+import net.pterodactylus.irc.util.MessageCleaner;
import net.pterodactylus.xdcc.core.Core;
import net.pterodactylus.xdcc.core.event.DownloadFailed;
import net.pterodactylus.xdcc.core.event.DownloadFinished;
import net.pterodactylus.xdcc.core.event.DownloadStarted;
+import net.pterodactylus.xdcc.core.event.MessageReceived;
import net.pterodactylus.xdcc.data.Bot;
import net.pterodactylus.xdcc.data.Download;
import net.pterodactylus.xdcc.data.Pack;
}
}
+ /**
+ * Displays the received message on the console.
+ *
+ * @param messageReceived
+ * The message received event
+ */
+ @Subscribe
+ public void messageReceived(MessageReceived messageReceived) {
+ try {
+ writeLine(String.format("Message from %s: %s", messageReceived.source(), MessageCleaner.getDefaultInstance().clean(messageReceived.message())));
+ } catch (IOException e) {
+ /* ignore. */
+ }
+ }
+
//
// PRIVATE METHODS
//