aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/petpet.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-12 22:22:37 +0200
committerVendicated <vendicated@riseup.net>2022-10-12 22:22:37 +0200
commit8817e2dff71f4736f4f8c9011457d20e63ec4ca3 (patch)
tree27bcbbbd86210cfcaa518831ed7e456c2c769762 /src/plugins/petpet.ts
parent267b2b1a0703313311da01addafcee28100347ea (diff)
downloadVencord-8817e2dff71f4736f4f8c9011457d20e63ec4ca3.tar.gz
Vencord-8817e2dff71f4736f4f8c9011457d20e63ec4ca3.tar.bz2
Vencord-8817e2dff71f4736f4f8c9011457d20e63ec4ca3.zip
Reorganise command plugins
Diffstat (limited to 'src/plugins/petpet.ts')
-rw-r--r--src/plugins/petpet.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/petpet.ts b/src/plugins/petpet.ts
index 6b0fd4f..0c4c29b 100644
--- a/src/plugins/petpet.ts
+++ b/src/plugins/petpet.ts
@@ -1,7 +1,7 @@
import { ApplicationCommandOptionType, findOption, ApplicationCommandInputType, Argument, CommandContext } from "../api/Commands";
import { Devs } from "../utils/constants";
import definePlugin from "../utils/types";
-import { lazy, lazyWebpack, suppressErrors } from "../utils/misc";
+import { lazy, lazyWebpack } from "../utils/misc";
import { filters } from "../webpack";
const DRAFT_TYPE = 0;
@@ -36,7 +36,7 @@ function loadImage(source: File | string) {
URL.revokeObjectURL(url);
resolve(img);
};
- img.onerror = reject;
+ img.onerror = (event, _source, _lineno, _colno, err) => reject(err || event);
img.crossOrigin = "Anonymous";
img.src = url;
});
@@ -109,7 +109,7 @@ export default definePlugin({
type: ApplicationCommandOptionType.BOOLEAN
}
],
- execute: suppressErrors("petpetExecute", async (opts, cmdCtx) => {
+ execute: async (opts, cmdCtx) => {
const { GIFEncoder, quantize, applyPalette } = await getGifEncoder();
const frames = await getFrames();
@@ -162,7 +162,7 @@ export default definePlugin({
// 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));
- }),
+ },
},
]
});