diff --git a/src/plugins/randomiseFileNames.ts b/src/plugins/randomiseFileNames.ts index eeaef3a3..3826711d 100644 --- a/src/plugins/randomiseFileNames.ts +++ b/src/plugins/randomiseFileNames.ts @@ -23,6 +23,6 @@ export default definePlugin({ { length: 7 }, () => chars[Math.floor(Math.random() * chars.length)] ).join(""); - return rand + window.DiscordNative.fileManager.extname(file); + return rand + (file.lastIndexOf(".") > -1 ? file.slice(file.lastIndexOf(".")) : "") }, });