diff --git a/src/structure/components/observers/ErrorLog.js b/src/structure/components/observers/ErrorLog.js index a5587a7..0e78507 100644 --- a/src/structure/components/observers/ErrorLog.js +++ b/src/structure/components/observers/ErrorLog.js @@ -1,3 +1,4 @@ +const { Util } = require("../../../utilities"); const { Observer } = require("../../interfaces"); const COLOURS = { @@ -19,7 +20,8 @@ class ErrorLog extends Observer { ['wordWatcherError', this.wordWatcher.bind(this)], ['logError', this.logError.bind(this)], ['utilityError', this.utilityError.bind(this)], - ['linkFilterWarn', this.linkFilterWarn.bind(this)] + ['linkFilterWarn', this.linkFilterWarn.bind(this)], + ['filterMissingPermissions', this.filterMissingPermissions.bind(this)] ]; } @@ -136,6 +138,17 @@ class ErrorLog extends Observer { this.post(guild, embed, 'linkFilterWarn'); } + filterMissingPermissions({ guild, filter, permissions, channel }) { + const embed = { + description: guild.format(`FILTER_MISSING_PERMISSIONS`, { + filter: Util.capitalise(filter), + channel: channel.name, + permissions: permissions.join(', ') + }) + }; + this.post(guild, embed, 'filterMissingPermissions'); + } + async post(guild, embed, type) { const settings = await guild.settings(); const { errors } = settings;