aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2023-01-09 23:18:49 +0100
committerVendicated <vendicated@riseup.net>2023-01-09 23:19:00 +0100
commita772aa62f55ff16a42ab62f910fb6fcba8d48c32 (patch)
treea3ed4554ba60f2766b82e846b0e9eb90f804b809
parent23a461c36d7a2d9dbea4d0fc8f3a62d226aef3de (diff)
downloadVencord-a772aa62f55ff16a42ab62f910fb6fcba8d48c32.tar.gz
Vencord-a772aa62f55ff16a42ab62f910fb6fcba8d48c32.tar.bz2
Vencord-a772aa62f55ff16a42ab62f910fb6fcba8d48c32.zip
Fix PetPet & CorruptMp4s
-rw-r--r--.gitattributes1
-rw-r--r--src/plugins/corruptMp4s.ts2
-rw-r--r--src/plugins/petpet.ts4
3 files changed, 4 insertions, 3 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..6313b56
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto eol=lf
diff --git a/src/plugins/corruptMp4s.ts b/src/plugins/corruptMp4s.ts
index 5ae25ee..b9c3a11 100644
--- a/src/plugins/corruptMp4s.ts
+++ b/src/plugins/corruptMp4s.ts
@@ -99,7 +99,7 @@ export default definePlugin({
const newName = video.name.replace(/\.mp4$/i, ".corrupt.mp4");
const promptToUpload = findByCode("UPLOAD_FILE_LIMIT_ERROR");
const file = new File([buf], newName, { type: "video/mp4" });
- setImmediate(() => promptToUpload([file], ctx.channel, DRAFT_TYPE));
+ setTimeout(() => promptToUpload([file], ctx.channel, DRAFT_TYPE), 10);
}
}]
});
diff --git a/src/plugins/petpet.ts b/src/plugins/petpet.ts
index a8281d0..0d9a3d0 100644
--- a/src/plugins/petpet.ts
+++ b/src/plugins/petpet.ts
@@ -175,8 +175,8 @@ export default definePlugin({
gif.finish();
const file = new File([gif.bytesView()], "petpet.gif", { type: "image/gif" });
// Immediately after the command finishes, Discord clears all input, including pending attachments.
- // Thus, setImmediate is needed to make this execute after Discord cleared the input
- setImmediate(() => promptToUpload([file], cmdCtx.channel, DRAFT_TYPE));
+ // Thus, setTimeout is needed to make this execute after Discord cleared the input
+ setTimeout(() => promptToUpload([file], cmdCtx.channel, DRAFT_TYPE), 10);
},
},
]