oops forgot to add back the if statement

This commit is contained in:
byron 2024-03-15 21:31:05 -04:00
parent 610c48fe92
commit 1947cedd55

View file

@ -125,8 +125,8 @@ export default definePlugin({
required: false required: false
}, },
{ {
name: "attachment", name: "pfp",
description: "Send with a custom attachment.", description: "Send with a custom profile picture.",
type: ApplicationCommandOptionType.ATTACHMENT, type: ApplicationCommandOptionType.ATTACHMENT,
required: false required: false
}, },
@ -141,7 +141,7 @@ export default definePlugin({
const webhookUrl = findOption(option, "url"); const webhookUrl = findOption(option, "url");
const webhookMessage = findOption(option, "message"); const webhookMessage = findOption(option, "message");
const webhookAttachment = findOption(option, "attachment"); const webhookProfilePic = findOption(option, "pfp");
let webhookUsername = findOption(option, "username"); let webhookUsername = findOption(option, "username");
if (findOption(option, "raw")) { if (findOption(option, "raw")) {
Native.executeWebhook("" + webhookUrl, { Native.executeWebhook("" + webhookUrl, {
@ -149,14 +149,15 @@ export default definePlugin({
}); });
} }
else { else {
webhookUsername = undefined; if (webhookUsername === "") {
webhookUsername = undefined;
}
Native.executeWebhook("" + webhookUrl, { Native.executeWebhook("" + webhookUrl, {
content: webhookMessage, content: webhookMessage,
username: webhookUsername, username: webhookUsername,
avatar_url: "", avatar_url: webhookProfilePic,
tts: findOption(option, "tts"), tts: findOption(option, "tts"),
attachments: webhookAttachment
}); });
} }