diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/invisibleChat/index.tsx | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/plugins/invisibleChat/index.tsx b/src/plugins/invisibleChat/index.tsx index fb173ee..6f21628 100644 --- a/src/plugins/invisibleChat/index.tsx +++ b/src/plugins/invisibleChat/index.tsx @@ -22,7 +22,7 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import { getStegCloak } from "@utils/dependencies"; import definePlugin, { OptionType } from "@utils/types"; -import { Button, ButtonLooks, ButtonWrapperClasses, ChannelStore, FluxDispatcher, Tooltip } from "@webpack/common"; +import { Button, ButtonLooks, ButtonWrapperClasses, ChannelStore, FluxDispatcher, RestAPI, Tooltip } from "@webpack/common"; import { Message } from "discord-types/general"; import { buildDecModal } from "./components/DecryptionModal"; @@ -123,7 +123,7 @@ const settings = definePluginSettings({ export default definePlugin({ name: "InvisibleChat", - description: "Encrypt your Messages in a non-suspicious way! This plugin makes requests to >>https://embed.sammcheese.net<< to provide embeds to decrypted links!", + description: "Encrypt your Messages in a non-suspicious way!", authors: [Devs.SammCheese], dependencies: ["MessagePopoverAPI"], patches: [ @@ -178,25 +178,13 @@ export default definePlugin({ // Gets the Embed of a Link async getEmbed(url: URL): Promise<Object | {}> { - const controller = new AbortController(); - const timeout = setTimeout(() => controller.abort(), 5000); - - const options: RequestInit = { - signal: controller.signal, - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - url, - }), - }; - - // AWS hosted url to discord embed object - const rawRes = await fetch(this.EMBED_API_URL, options); - clearTimeout(timeout); - - return await rawRes.json(); + const { body } = await RestAPI.post({ + url: "/unfurler/embed-urls", + body: { + urls: [url] + } + }); + return await body.embeds[0]; }, async buildEmbed(message: any, revealed: string): Promise<void> { |