authorgravatar for nathanalex66@gmail.comNathan Alex <nathanalex66@gmail.com> 2023-04-06 18:55:24-04:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-01-02 23:03:56-08:00
log62f9775932d4ff234fb1a6e998a2d5a11c387dbb
tree492e3a191d69d9951ef02951cc07d94c41a18d73
parent9ae9951e345bd662bd9ea335e6a6c91a58fc455c

Fixed wrong event handler.

Updated `client.on('warn'...);` as I misspelled it as `error`. Additionally updated it so it does not close the process when a warning occurs.

1 files changed, 1 insertions(+), 4 deletions(-)

index.ts+1-4
...@@ -221,13 +221,10 @@ client.on('invalidated', function () {...@@ -221,13 +221,10 @@ client.on('invalidated', function () {
221});221});
222222
223// Client warning handler (which might not require restarting but just to be safe.)223// Client warning handler (which might not require restarting but just to be safe.)
224client.on('error', function (info) {224client.on('warn', function (info) {
225 // Writes a log of what happened to a log file.225 // Writes a log of what happened to a log file.
226 fs.writeFileSync(226 fs.writeFileSync(
227 path.join('logs', `${Date.now()}.warn`),227 path.join('logs', `${Date.now()}.warn`),
228 `Warning: ${info}`228 `Warning: ${info}`
229 );229 );
230
231 // Exits the process (and hopefully restarts!)
232 process.exit();
233});230});