Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit e0c423d

Browse files
committed
chore(nsfw): update nsfw model
1 parent b225da6 commit e0c423d

File tree

8 files changed

+122
-127
lines changed

8 files changed

+122
-127
lines changed

locales

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"type": "module",
2121
"dependencies": {
2222
"@prisma/client": "^5.10.2",
23-
"@sentry/node": "^7.104.0",
23+
"@sentry/node": "^7.105.0",
2424
"@tensorflow/tfjs-node": "^4.17.0",
2525
"@top-gg/sdk": "^3.1.6",
2626
"common-tags": "^1.8.2",
@@ -33,11 +33,11 @@
3333
"js-yaml": "^4.1.0",
3434
"lodash": "^4.17.21",
3535
"lz-string": "^1.5.0",
36-
"nsfwjs": "^3.0.0",
36+
"nsfwjs": "^4.1.0",
3737
"parse-duration": "^1.1.0",
3838
"sharp": "^0.33.2",
3939
"source-map-support": "^0.5.21",
40-
"winston": "^3.11.0"
40+
"winston": "^3.12.0"
4141
},
4242
"devDependencies": {
4343
"@stylistic/eslint-plugin": "^1.6.3",
@@ -46,7 +46,7 @@
4646
"@types/i18n": "^0.13.10",
4747
"@types/js-yaml": "^4.0.9",
4848
"@types/lodash": "^4.14.202",
49-
"@types/node": "^20.11.24",
49+
"@types/node": "^20.11.25",
5050
"@types/source-map-support": "^0.5.10",
5151
"cz-conventional-changelog": "^3.3.0",
5252
"eslint": "8.57.0",
@@ -56,8 +56,8 @@
5656
"prisma": "^5.10.2",
5757
"standard-version": "^9.5.0",
5858
"tsc-watch": "^6.0.4",
59-
"typescript": "^5.3.3",
60-
"typescript-eslint": "^7.1.0"
59+
"typescript": "^5.4.2",
60+
"typescript-eslint": "^7.1.1"
6161
},
6262
"config": {
6363
"commitizen": {

src/api/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import nsfwRouter from './routes/nsfw.js';
88
export const startApi = (data: { voteManager: VoteManager }) => {
99
const app = express();
1010

11-
app.use(express.static('src/api/public'));
1211
app.use(express.json());
1312
app.use(express.urlencoded({ extended: true }));
1413
app.use(nsfwRouter);
-2.5 MB
Binary file not shown.

src/api/public/model/model.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/api/routes/nsfw.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Logger from '../../utils/Logger.js';
66
import sharp from 'sharp';
77
import jpeg from 'jpeg-js';
88

9-
let nsfwModel;
9+
const nsfwModel = await load('MobileNetV2');
1010
const router: Router = Router();
1111

1212
const imageToTensor = async (rawImageData: ArrayBuffer) => {
@@ -28,8 +28,6 @@ const imageToTensor = async (rawImageData: ArrayBuffer) => {
2828
};
2929

3030
router.get('/nsfw', async (req, res) => {
31-
nsfwModel = await load('http://localhost:443/model/');
32-
3331
const url = new URL(req.url, `http://${req.headers.host}`);
3432
const imageUrl = url.searchParams.get('url');
3533

src/commands/slash/Main/connection.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ export default class Connection extends BaseCommand {
133133
components: [customizeMenu, buttons],
134134
});
135135

136-
// TODO Button expiration
137136
setComponentExpiry(
138137
interaction.client.getScheduler(),
139138
await interaction.fetchReply(),

0 commit comments

Comments
 (0)