Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
fix: error on no filter
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev committed Jun 24, 2023
1 parent b4ee09a commit 234811d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/filter/filters/profranity.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module.exports = async function profanity(message) {
const filterSchema = require("../../../models/filterSchema");
const replaceContent = require("../replaceContent");

const blockFilter = await filterSchema.findOne({ _id: "block" });
const autobanFilter = await filterSchema.findOne({ _id: "autoban" });
const blockFilter = await filterSchema.findOne({ _id: "block" }) || { words: [] };
const autobanFilter = await filterSchema.findOne({ _id: "autoban" }) || { words: [] };

const content = replaceContent(message.content.toLowerCase());

Expand Down

0 comments on commit 234811d

Please sign in to comment.