error logger stuff

This commit is contained in:
Erik 2022-07-04 11:42:43 +03:00
parent aad858a510
commit 8a8a1f28e6
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -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;