class UserMessageListener {
	private DiscordInstance instance;
	private final List<MessageHandler> messageHandlers;

	public UserMessageListener(List<MessageHandler> messageHandlers) {
		this.messageHandlers = messageHandlers;
	}

	public void setInstance(DiscordInstance instance) {
		this.instance = instance;
	}

	public void onMessage(DataObject raw) {<FILL_FUNCTION_BODY>}

	private boolean ignoreAndLogMessage(DataObject data, MessageType messageType) {
		String channelId = data.getString("channel_id");
		if (!CharSequenceUtil.equals(channelId, this.instance.account().getChannelId())) {
			return true;
		}
		String authorName = data.optObject("author").map(a -> a.getString("username")).orElse("System");
		log.debug("{} - {} - {}: {}", this.instance.account().getDisplay(), messageType.name(), authorName, data.opt("content").orElse(""));
		return false;
	}
}

		MessageType messageType = MessageType.of(raw.getString("t"));
		if (messageType == null || MessageType.DELETE == messageType) {
			return;
		}
		DataObject data = raw.getObject("d");
		if (ignoreAndLogMessage(data, messageType)) {
			return;
		}
		ThreadUtil.sleep(50);
		for (MessageHandler messageHandler : this.messageHandlers) {
			if (data.getBoolean(Constants.MJ_MESSAGE_HANDLED, false)) {
				return;
			}
			messageHandler.handle(this.instance, messageType, data);
		}
	
<no_super_class>