1
0
Fork 0

Fix, don't error if dm fails

refactor/models
Bsian 2019-10-26 18:34:29 +01:00
parent 80d1f5a7dd
commit 851af0f0bf
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
2 changed files with 3 additions and 4 deletions

View File

@ -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); 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.setFooter(this.client.user.username, this.client.user.avatarURL);
embed.setTimestamp(); embed.setTimestamp();
// @ts-ignore
this.client.getDMChannel(account.userID).then((user) => { this.client.getDMChannel(account.userID).then((user) => {
// @ts-ignore // @ts-ignore
user.createMessage({ embed }); user.createMessage({ embed }).catch();
}); });
// @ts-ignore // @ts-ignore
this.client.createMessage('580950455581147146', { embed }); this.client.createMessage('580950455581147146', { embed });

View File

@ -43,8 +43,8 @@ export default class Unlock extends Command {
embed.setTimestamp(); embed.setTimestamp();
this.client.getDMChannel(account.userID).then((user) => { this.client.getDMChannel(account.userID).then((user) => {
// @ts-ignore // @ts-ignore
user.createMessage({ embed }); user.createMessage({ embed }).catch();
}).catch(); });
// @ts-ignore // @ts-ignore
this.client.createMessage('580950455581147146', { embed }); this.client.createMessage('580950455581147146', { embed });
} catch (error) { } catch (error) {