Skip to content

Commit

Permalink
add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
ender-null committed May 22, 2024
1 parent b1c656e commit 2bb9e59
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/plugins/spica.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down

0 comments on commit 2bb9e59

Please sign in to comment.