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

Commit 8840632

Browse files
committed
revert: revert "chore(nsfw): update nsfw model"
This reverts commit e0c423d.
1 parent e0c423d commit 8840632

File tree

8 files changed

+127
-122
lines changed

8 files changed

+127
-122
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.105.0",
23+
"@sentry/node": "^7.104.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": "^4.1.0",
36+
"nsfwjs": "^3.0.0",
3737
"parse-duration": "^1.1.0",
3838
"sharp": "^0.33.2",
3939
"source-map-support": "^0.5.21",
40-
"winston": "^3.12.0"
40+
"winston": "^3.11.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.25",
49+
"@types/node": "^20.11.24",
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.4.2",
60-
"typescript-eslint": "^7.1.1"
59+
"typescript": "^5.3.3",
60+
"typescript-eslint": "^7.1.0"
6161
},
6262
"config": {
6363
"commitizen": {

src/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ 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'));
1112
app.use(express.json());
1213
app.use(express.urlencoded({ extended: true }));
1314
app.use(nsfwRouter);
2.5 MB
Binary file not shown.

src/api/public/model/model.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

src/api/routes/nsfw.ts

Lines changed: 3 additions & 1 deletion
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-
const nsfwModel = await load('MobileNetV2');
9+
let nsfwModel;
1010
const router: Router = Router();
1111

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

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

src/commands/slash/Main/connection.ts

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

136+
// TODO Button expiration
136137
setComponentExpiry(
137138
interaction.client.getScheduler(),
138139
await interaction.fetchReply(),

0 commit comments

Comments
 (0)