From 9c7c3d0c5da22f623510f66d4af89192e4502843 Mon Sep 17 00:00:00 2001 From: byron <47872200+byeoon@users.noreply.github.com> Date: Fri, 15 Mar 2024 18:44:30 -0400 Subject: [PATCH] fixed that god-awful annoying bug where you couldnt use the default webhook name --- src/plugins/WebhookManager/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/WebhookManager/index.tsx b/src/plugins/WebhookManager/index.tsx index c10278ff8..a24574022 100644 --- a/src/plugins/WebhookManager/index.tsx +++ b/src/plugins/WebhookManager/index.tsx @@ -139,7 +139,7 @@ export default definePlugin({ name: "username", description: "Send with a custom webhook username", type: ApplicationCommandOptionType.STRING, - required: true + required: false }, { name: "tts", @@ -165,9 +165,11 @@ export default definePlugin({ }); } else { + fetch("" + webhookUrl).then(response => response.json().then(response => { if (webhookUsername === "") { webhookUsername = response.name; } })); + Native.executeWebhook("" + webhookUrl, { content: webhookMessage, - username: webhookUsername ?? fetch("" + webhookUrl).then(response => response.json().then(response => { webhookUsername = response.name; })), + username: webhookUsername, avatar_url: "", tts: findOption(option, "tts") });