Fixed !clear command to clear server-side chatBuffer as well as client buffers.

This commit is contained in:
rainbow napkin 2025-09-10 03:43:15 -04:00
parent 9eeed591ad
commit de11803cea
3 changed files with 51 additions and 5 deletions

View file

@ -176,8 +176,11 @@ module.exports.errorMiddleware = function(err, req, res, next){
module.exports.dumpError = function(err, date = new Date()){
try{
const content = `Error Date: ${date.toLocaleString()} (UTC-${date.getTimezoneOffset()/60})\nError Type: ${err.name}\nError Msg:${err.message}\nStack Trace:\n\n${err.stack}`;
const path = `log/crash/${date.getTime()}.log`;
fs.writeFile(`log/crash/${date.getTime()}.log`, content);
fs.writeFile(path, content);
module.exports.consoleWarn(`Warning: Unexpected Server Crash gracefully dumped to '${path}'... SOMETHING MAY BE VERY BROKEN!!!!`);
}catch(doubleErr){
module.exports.consoleWarn("Yo Dawg, I herd you like errors, so I put an error in your error dump, so you can dump while you dump:");
module.exports.consoleWarn(err);