Fix NSFW directory

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-01-08 14:02:56 -06:00
parent 1ea174b629
commit 3b7a79573b
Signed by: sam
GPG Key ID: 4D8B07C18F31ACBD
2 changed files with 7 additions and 4 deletions

View File

@ -83,9 +83,9 @@ let image: fs.ReadStream;
let sensitivity: boolean;
if (random >= sfw_files.length) {
// Image is NSFW, mark it sensitive
image = fs.createReadStream(args.directory + "/nsfw" + nsfw_files[ random - sfw_files.length ])
image = fs.createReadStream(args.directory + "/nsfw/" + nsfw_files[ random - sfw_files.length ])
.on("error", (err: Error) => {
console.log("Error reading image from NSFW directory: " + err.message);
console.error("Error reading image from NSFW directory: " + err.message);
if (args.verbose) {
console.error("--BEGIN FULL ERROR--");
console.error(err);
@ -99,7 +99,7 @@ else {
// Image is SFW, mark it not sensitive
image = fs.createReadStream(args.directory + "/sfw/" + sfw_files[ random ])
.on("error", (err: Error) => {
console.log("Error reading image from SFW directory:" + err.message);
console.error("Error reading image from SFW directory:" + err.message);
if (args.verbose) {
console.error("--BEGIN FULL ERROR--");
console.error(err);
@ -112,6 +112,8 @@ else {
const client = generator(data.type, data.instance, data.accessToken);
client.uploadMedia(image).then((res: Response<Entity.Attachment>) => {
if (args.verbose)
console.log(res.data);
client.postStatus(args.message, {
media_ids: [ res.data.id ],
visibility: "unlisted",

View File

@ -15,8 +15,9 @@
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
"removeComments": true, /* Do not emit comments to output. */
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
"importHelpers": true, /* Import emit helpers from 'tslib'. */
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */