Skip to main content

Overview

The WarnPlayer function allows staff members to issue warnings to players for rule violations. All warnings are automatically logged and can trigger Discord webhook notifications if configured.

WarnPlayer

Issue a warning to a player for rule violations.

Syntax

Parameters

  • staffId (number) - Server ID of the staff member issuing the warning
  • targetId (number) - Server ID of the player receiving the warning
  • reason (string) - Reason for the warning (minimum 3 characters)

Returns

  • success (boolean) - Whether the warning was successfully issued
  • status (string) - Status code: 'success', 'no_permission', 'player_not_found', 'invalid_target', 'invalid_reason'

Example

Advanced Examples

Warning System with Escalation

Warning Categories System

Warning History Analysis

Bulk Warning System

Error Handling

Handle common scenarios when issuing warnings:
Warnings are permanently stored and can be viewed by staff members. Use clear, specific reasons that explain the rule violation.
Consider implementing warning categories and escalation systems to maintain consistency in your server’s moderation approach.