From 2bb9e59e4606c0151fb9d2f516f145478e351c8d Mon Sep 17 00:00:00 2001 From: ender Date: Wed, 22 May 2024 03:33:19 +0200 Subject: [PATCH] add debug info --- src/plugins/spica.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/spica.ts b/src/plugins/spica.ts index 0412470..9e37129 100644 --- a/src/plugins/spica.ts +++ b/src/plugins/spica.ts @@ -42,6 +42,7 @@ export class SpicaPlugin extends PluginBase { logger.info('before websocket'); const ws: WebSocket = new WebSocket('wss://spica.end.works/wired'); logger.info('after websocket'); + ws.on('ready', () => { logger.info('spica ready'); if (isCommand(this, 1, msg.content)) { @@ -53,6 +54,15 @@ export class SpicaPlugin extends PluginBase { } }); + ws.on('error', async (error: ErrorEvent) => { + logger.info('spica error'); + logger.error(error); + }); + + ws.on('close', (code) => { + logger.info(`spica close ${code}`); + }); + ws.on('message', (data: string) => { logger.info('spica message'); let text = this.bot.errors.noResults;