import express from 'express';
import { ChatSystem } from '../../../../features/chat';
import { motdSystem } from '../../../../features/motd';
import { ChatColors } from '../../../../const/chat-colors';

export async function MotdReload(req: express.Request, res: express.Response): Promise<express.Response<any, Record<string, any>>> {
    if (!req.body.by) {
        res.status(400).send('Missing parameter');
    }

    ChatSystem.AdminWarn(`${req.body.by} reloaded the MOTDs.`);

    await motdSystem.init();

    return res.sendStatus(200);
}
