From efc78ee82b69afcdfcbbad4fe3eb5c04db21f79c Mon Sep 17 00:00:00 2001 From: Sorunome <mail@sorunome.de> Date: Wed, 1 May 2019 16:35:42 +0100 Subject: [PATCH] Yes, this is better Co-Authored-By: Half-Shot <will@half-shot.uk> --- src/clientfactory.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/clientfactory.ts b/src/clientfactory.ts index 18c8a2e..ff1f086 100644 --- a/src/clientfactory.ts +++ b/src/clientfactory.ts @@ -65,7 +65,11 @@ export class DiscordClientFactory { await client.login(token); const id = client.user.id; - client.destroy().catch(() => { + try { + await client.destroy(); + } catch (err) { + log.warn("Failed to destroy client ", id); + } log.warn("Failed to destroy client ", id); }); return id; -- GitLab