fixed that god-awful annoying bug where you couldnt use the default webhook name

This commit is contained in:
byron 2024-03-15 18:44:30 -04:00
parent f43f404123
commit 9c7c3d0c5d

View file

@ -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")
});