package com.openosrs.client.api.types;

public class ChatMessage {
    private final String username;
    private final String message;
    private final int type;
    private final long timestamp;

    public ChatMessage(String username, String message, int type) {
        this.username = username;
        this.message = message;
        this.type = type;
        this.timestamp = System.currentTimeMillis();
    }

    public String getUsername() { return username; }
    public String getMessage() { return message; }
    public int getType() { return type; }
    public long getTimestamp() { return timestamp; }

    public boolean isPublicChat() { return type == 0; }
    public boolean isPrivateMessage() { return type == 3; }
    public boolean isFriendChat() { return type == 9; }
    public boolean isClanChat() { return type == 11; }

    @Override
    public String toString() {
        return String.format("ChatMessage[%s]: %s", username, message);
    }
}
