From ecaa8611357748e4f18ed1b8bc1df541e12df2c5 Mon Sep 17 00:00:00 2001 From: Bsian Date: Wed, 20 May 2020 12:17:47 +0100 Subject: [PATCH 1/2] Send debugs to see reason for ws disconnect --- src/main.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.ts b/src/main.ts index 5213da2..15a9f77 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,6 +3,7 @@ */ import { parse } from 'yaml'; import { promises as fs } from 'fs'; +import { TextChannel } from 'eris'; import { Client } from './class'; async function main(): Promise { @@ -16,6 +17,7 @@ async function main(): Promise { await client.loadEvents(); await client.loadCommands(); client.connect(); + client.once('ready', () => client.on('debug', (message) => (client.getChannel('592170164322041856') as TextChannel).createMessage(message))); } main(); From ef22cd76ddfa5b81ddebf33c55c3eac8306eae5a Mon Sep 17 00:00:00 2001 From: Bsian Date: Wed, 20 May 2020 14:52:11 +0100 Subject: [PATCH 2/2] Stop debugging messages --- src/main.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 15a9f77..80839a1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,7 +17,10 @@ async function main(): Promise { await client.loadEvents(); await client.loadCommands(); client.connect(); - client.once('ready', () => client.on('debug', (message) => (client.getChannel('592170164322041856') as TextChannel).createMessage(message))); + client.once('ready', () => client.on('debug', (message) => { + if (message.includes('/messages')) return; + (client.getChannel('592170164322041856') as TextChannel).createMessage(message); + })); } main();