From 851af0f0bf0b140df004d3f6f4ff7c238114b36b Mon Sep 17 00:00:00 2001 From: Bsian Date: Sat, 26 Oct 2019 18:34:29 +0100 Subject: [PATCH] Fix, don't error if dm fails --- src/commands/lock.ts | 3 +-- src/commands/unlock.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/commands/lock.ts b/src/commands/lock.ts index b683e7b..69e81de 100644 --- a/src/commands/lock.ts +++ b/src/commands/lock.ts @@ -57,10 +57,9 @@ export default class Lock extends Command { if ((momentMilliseconds ? args.slice(2).join(' ') : args.slice(1).join(' ')).length > 0) embed.addField('Reason', momentMilliseconds ? args.slice(2).join(' ') : args.slice(1).join(' '), true); embed.setFooter(this.client.user.username, this.client.user.avatarURL); embed.setTimestamp(); - // @ts-ignore this.client.getDMChannel(account.userID).then((user) => { // @ts-ignore - user.createMessage({ embed }); + user.createMessage({ embed }).catch(); }); // @ts-ignore this.client.createMessage('580950455581147146', { embed }); diff --git a/src/commands/unlock.ts b/src/commands/unlock.ts index 965cb33..2a1c46e 100644 --- a/src/commands/unlock.ts +++ b/src/commands/unlock.ts @@ -43,8 +43,8 @@ export default class Unlock extends Command { embed.setTimestamp(); this.client.getDMChannel(account.userID).then((user) => { // @ts-ignore - user.createMessage({ embed }); - }).catch(); + user.createMessage({ embed }).catch(); + }); // @ts-ignore this.client.createMessage('580950455581147146', { embed }); } catch (error) {