diff --git a/src/plugins/WebhookManager/index.tsx b/src/plugins/WebhookManager/index.tsx index d44541a50..8548785f6 100644 --- a/src/plugins/WebhookManager/index.tsx +++ b/src/plugins/WebhookManager/index.tsx @@ -6,9 +6,9 @@ import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands"; import { Devs } from "@utils/constants"; +import { Logger } from "@utils/Logger"; import definePlugin, { PluginNative } from "@utils/types"; import { RestAPI } from "@webpack/common"; -import { Logger } from "@utils/Logger"; const Native = VencordNative.pluginHelpers.WebhookManager as PluginNative; const WMLogger = new Logger("WebhookManager"); @@ -72,15 +72,24 @@ export default definePlugin({ await fetch("" + webhookUrl).then(response => response.json()) .then(response => { WMLogger.info(JSON.stringify(response)); + if (response.type === 2) { + const sourceGuild = response.source_guild; + const sourceChannel = response.source_channel; + } sendBotMessage(ctx.channel.id, { embeds: [ { - title: "Webhook Information", + // @ts-ignore + title: ` ${response.name}'s Webhook Information`, + color: '#00007d', author: { - icon_url: `https://cdn.discordapp.com/avatars/${response.id}/${response.avatar}.png` + // @ts-ignore + icon_url: `https://cdn.discordapp.com/avatars/${response.id}/${response.avatar}.png`, + proxy_icon_url: `https://cdn.discordapp.com/avatars/${response.id}/${response.avatar}.png`, + name: response.name, + url: "" }, - content: ` - Webhook Username: ${response.name} + description: ` Webhook ID: ${response.id} Webhook Token: ${response.token} Webhook Type: ${response.type} @@ -156,4 +165,4 @@ export default definePlugin({ } } ] -});;;;; +}); diff --git a/src/plugins/WebhookManager/native.ts b/src/plugins/WebhookManager/native.ts index 0df881f71..ae2f108dd 100644 --- a/src/plugins/WebhookManager/native.ts +++ b/src/plugins/WebhookManager/native.ts @@ -4,7 +4,6 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ - /* todo: also add web support (should be as easy as if navigator is on web or smthn like that, might even have a variable for that somewhere) (thank you official vendicated vending machine 2024 real) @@ -22,9 +21,9 @@ export function executeWebhook(_, url: string, body: object) { { method: "POST", headers: { - 'Content-Type': 'application/json', + "Content-Type": "application/json", } }); req.write(JSON.stringify(body)); req.end(); -} \ No newline at end of file +}