change filler rules

This commit is contained in:
Ajay 2022-07-29 11:29:39 -04:00
parent 5e49ce22b2
commit 186f07b20c

View file

@ -1,4 +1,5 @@
import { config } from "../config";
import { db } from "../databases/databases";
import { Category } from "../types/segments.model";
import { Feature, HashedUserID } from "../types/user.model";
import { hasFeature } from "./features";
@ -22,7 +23,8 @@ export async function canSubmit(userID: HashedUserID, category: Category): Promi
return {
canSubmit: (await isUserVIP(userID))
|| (await getReputation(userID)) > config.minReputationToSubmitFiller
|| (await hasFeature(userID, Feature.FillerSubmitter)),
|| (await hasFeature(userID, Feature.FillerSubmitter))
|| (await db.prepare("get", `SELECT count(*) as "submissionCount" FROM "sponsorTimes" WHERE "userID" = ? AND category != 'filler' AND "timeSubmitted" < 1654010691000 LIMIT 4`, [userID], { useReplica: true }))?.submissionCount > 3,
reason: "Someone has submitted over 1.9 million spam filler submissions and refuses to stop even after talking with them, so we have to restrict it for now. You can request submission access on chat.sponsor.ajay.app/#filler, discord.gg/SponsorBlock or matrix.to/#/#sponsor:ajay.app"
};
}