This commit is contained in:
Erik 2022-09-11 15:35:49 +03:00
parent b5bf445ce4
commit f340017492
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -422,9 +422,11 @@ module.exports = class AutoModeration extends Observer {
async filterLinks(message, edited) { async filterLinks(message, edited) {
const { guild, author, guildWrapper: wrapper } = message; const { guild, author, guildWrapper: wrapper, channel } = message;
let { channel } = message; if (!channel) {
if (channel.partial) channel = await channel.fetch(); this.logger.warn(`Missing channel?\nChannelId: ${message.channelId}\nGuild: ${message.guildId}\nAuthor: ${inspect(author)}`, { broadcast: true });
return;
}
if (!guild || author.bot || message.filtered) return; if (!guild || author.bot || message.filtered) return;
const member = message.member || await guild.members.fetch(author.id).catch(() => null); const member = message.member || await guild.members.fetch(author.id).catch(() => null);