import express from 'express';
import { staffSystem } from '../../../../features/staff';

export async function GetTestersOnline(req: express.Request, res: express.Response): Promise<void> {
    const list = mp.players
        .toArray()
        .filter((player: PlayerMp) => staffSystem.isPlayerSupport(player))
        .map((p) => p.account?.name)
        .join(', ');

    if (!list.length || !list) {
        res.send({ list: `There are no testers online.` });
    } else {
        res.send({ list: `Testers Online: ${list}` });
    }
}
