import { world, Player } from '@minecraft/server';
import { Command } from '../../handler';
import { sendPlayerMessage, config } from '../../../config';
import { lifestealLogs } from '../../../lifesteal';

export function logsHelp(player: Player) {
    sendPlayerMessage(player, `§e§lLifesteal Help Page -- Logs§r§6
> See lifesteal logs (When a player gains or loses a heart, when a player uses a command, etc)

> Usage: ${config.prefix}logs

> Examples: [
${config.prefix}logs
]`);
}

new Command({
    name: `logs`,
    staffOnly: true,
    code({ player, args }) {
        const logs: string[] = [];
        lifestealLogs.filter((v, i) => lifestealLogs.indexOf(v) !== i);

        sendPlayerMessage(player, `§6Lifesteal Logs:\n(The time before §g>§6 is in the UTC time zone)\n${lifestealLogs.join(`\n`)}\n-----\nNote: Logs reset when the world restarts or when it hits 500`);
    }
});