diff --git a/src/equicordplugins/fixFileExtensions/index.tsx b/src/equicordplugins/fixFileExtensions/index.tsx index adeef42b6..9e3fd34d7 100644 --- a/src/equicordplugins/fixFileExtensions/index.tsx +++ b/src/equicordplugins/fixFileExtensions/index.tsx @@ -34,11 +34,10 @@ export default definePlugin({ patches: [ // Taken from AnonymiseFileNames { - find: "instantBatchUpload:", + find: 'type:"UPLOAD_START"', replacement: { - match: /uploadFiles:(\i),/, - replace: - "uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.fixExt(f)),$1(...args)),", + match: /await \i\.uploadFiles\((\i),/, + replace: "$1.forEach($self.fixExt),$&" }, predicate: () => !Settings.plugins.AnonymiseFileNames.enabled, }, diff --git a/src/equicordplugins/moreStickers/upload.ts b/src/equicordplugins/moreStickers/upload.ts index 82b5da1ea..2089d4d08 100644 --- a/src/equicordplugins/moreStickers/upload.ts +++ b/src/equicordplugins/moreStickers/upload.ts @@ -11,8 +11,8 @@ import { ChannelStore, UploadHandler } from "@webpack/common"; import { FFmpegState, Sticker } from "./types"; - -const MessageUpload = findByPropsLazy("instantBatchUpload"); +// eslint-disable-next-line @stylistic/quotes +const MessageUpload = findByPropsLazy(`type:"UPLOAD_START"`, "uploadFiles"); const CloudUpload = findLazy(m => m.prototype?.trackUploadFinished); const PendingReplyStore = findByPropsLazy("getPendingReply"); const MessageUtils = findByPropsLazy("sendMessage");