Skip to content

Commit

Permalink
channel availability checks for command log
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmusgerdin committed Jun 24, 2020
1 parent e45dfd3 commit 7a31f5c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/finalizers/devCommandLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ module.exports = class extends Finalizer {
.setFooter(message.author.tag, message.author.displayAvatarURL());

logChannel = await this.client.channels.get(logChannel);
return logChannel.send('', { disableEveryone: true, embed: embed });
if (logChannel) logChannel.send('', { disableEveryone: true, embed: embed });

return;
}

async dmCommandLog(message, runTime, logChannel) {
Expand All @@ -45,7 +47,9 @@ module.exports = class extends Finalizer {
.setFooter(message.author.tag, message.author.displayAvatarURL());

logChannel = await this.client.channels.get(logChannel);
return logChannel.send('', { disableEveryone: true, embed: embed });
if (logChannel) logChannel.send('', { disableEveryone: true, embed: embed });

return;
}

};

0 comments on commit 7a31f5c

Please sign in to comment.