Interface ModerationMessageFormatter


public interface ModerationMessageFormatter
Fills the punishment placeholders for id, reason, dates and remaining time into the messages shown to a punished player.
  • Method Details

    • createMuteContext

      Optional<MessageContext> createMuteContext(FPlayer fPlayer, MuteChecker.Status status)
      Builds the message telling a player why they may not speak.
      Parameters:
      fPlayer - the silenced player
      status - what is stopping them
      Returns:
      the message, or empty if nothing is
    • replacePlaceholders

      String replacePlaceholders(String message, FPlayer fReceiver, Moderation moderation)
      Fills in the placeholders from a punishment issued by this plugin.
      Parameters:
      message - the text with placeholders
      fReceiver - the player the text is for, which decides the date and time wording
      moderation - the punishment
      Returns:
      the filled-in text
    • replacePlaceholders

      String replacePlaceholders(String message, FPlayer fReceiver, ExternalModeration moderation)
      Fills in the placeholders from a punishment owned by another plugin.
      Parameters:
      message - the text with placeholders
      fReceiver - the player the text is for
      moderation - the punishment
      Returns:
      the filled-in text
    • replacePlaceholders

      String replacePlaceholders(String message, FPlayer fReceiver, long moderationId, long date, long time, String reason, boolean permanent)
      Fills in the placeholders from loose values, for punishments that were never stored.
      Parameters:
      message - the text with placeholders
      fReceiver - the player the text is for
      moderationId - the punishment id
      date - when it was issued, in milliseconds
      time - when it expires, in milliseconds
      reason - the stated reason
      permanent - whether it never expires
      Returns:
      the filled-in text
    • replacePlaceholders

      String replacePlaceholders(String message, String moderationId, String reason, String date, String time, String timeLeft)
      Fills in the placeholders from values that are already formatted for display.
      Parameters:
      message - the text with placeholders
      moderationId - the punishment id
      reason - the stated reason
      date - the formatted issue date
      time - the formatted expiry
      timeLeft - the formatted remaining time
      Returns:
      the filled-in text