DirectMessageHandler

class DirectMessageHandler(settingsManager: PlayerSettingsManager?, romanjiConverter: RomanjiConverter?)

Manages direct message state including reply targets. Tracks the last player who messaged each player for /reply functionality.

Constructors

Link copied to clipboard
constructor(settingsManager: PlayerSettingsManager?, romanjiConverter: RomanjiConverter?)

Functions

Link copied to clipboard
fun clearPlayer(player: Player)

Clears message history for a player (called on disconnect).

Link copied to clipboard
fun getReplyTarget(player: Player): Player?

Gets the player to reply to. First checks if someone has messaged this player, otherwise falls back to the last person they messaged.

Link copied to clipboard
fun recordMessage(sender: Player, recipient: Player)

Records a direct message between two players. Updates both the sender's last recipient and the receiver's last messager.

Link copied to clipboard
suspend fun sendDirectMessage(sender: Player, recipient: Player, message: String): Boolean

Sends a direct message from one player to another. Handles formatting and recording the conversation. Applies romaji-to-Japanese conversion if sender has it enabled.