error log
This commit is contained in:
parent
5c80bbe715
commit
777bbd0170
@ -15,7 +15,8 @@ class ErrorLog extends Observer {
|
||||
});
|
||||
|
||||
this.hooks = [
|
||||
['automodError', this.automod.bind(this)]
|
||||
['automodError', this.automod.bind(this)],
|
||||
['wordWatcherError', this.wordWatcher.bind(this)]
|
||||
];
|
||||
|
||||
}
|
||||
@ -37,7 +38,7 @@ class ErrorLog extends Observer {
|
||||
infractionReason: infraction.reason,
|
||||
reason: guild.format(`${reason}_AUTOMOD`)
|
||||
})}`;
|
||||
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
description: str,
|
||||
@ -47,6 +48,26 @@ class ErrorLog extends Observer {
|
||||
|
||||
}
|
||||
|
||||
async wordWatcher({ message, guild, warning }) {
|
||||
|
||||
const settings = await guild.settings();
|
||||
const { errors } = settings;
|
||||
const { channel: _channel, types } = errors;
|
||||
if (!_channel) return;
|
||||
|
||||
const channel = await guild.resolveChannel(_channel);
|
||||
|
||||
const str = `${guild.format(`WORDWATCHER_${warning ? 'WARN' : 'ERROR'}`)}\n${message}`;
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
description: str,
|
||||
color: COLOURS[warning ? 'warning' : 'fatal']
|
||||
}]
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = ErrorLog;
|
Loading…
Reference in New Issue
Block a user