This commit is contained in:
Ryan Cao 2022-05-21 20:36:53 +08:00
parent 1638a44797
commit bba0b1bce0
No known key found for this signature in database
GPG key ID: 528A2C1B6656B97F
2 changed files with 14 additions and 2 deletions

View file

@ -57,7 +57,19 @@ client.once('ready', async () => {
if (e.author.bot) return; if (e.author.bot) return;
if (e.author === client.user) return; if (e.author === client.user) return;
const profane = new Filter().isProfane(e.content); if (
process.env.NODE_ENV === 'development' &&
e.channelId !== '977401259260788756'
) {
return;
} else if (
process.env.NODE_ENV !== 'development' &&
e.channelId === '977401259260788756'
) {
return;
}
const profane = new Filter({ exclude: ['damn'] }).isProfane(e.content);
if (profane) { if (profane) {
e.reply({ e.reply({

View file

@ -3,7 +3,7 @@
"version": "0.0.1", "version": "0.0.1",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "nodemon --watch index.ts --exec esno index.ts", "dev": "NODE_ENV=development nodemon --watch index.ts --exec esno index.ts",
"build": "esbuild index.ts --format=cjs --platform=node --bundle --minify --outfile=index.js", "build": "esbuild index.ts --format=cjs --platform=node --bundle --minify --outfile=index.js",
"lint": "eslint **/*.ts" "lint": "eslint **/*.ts"
}, },