Also added the ability to send webhooks with TTS (For the sillies and goofs)

This commit is contained in:
byron 2024-03-13 13:07:51 -04:00 committed by GitHub
parent 4cb2661ae9
commit a6c7cb9517
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,6 +121,12 @@ export default definePlugin({
description: "Send message as raw JSON", description: "Send message as raw JSON",
type: ApplicationCommandOptionType.BOOLEAN, type: ApplicationCommandOptionType.BOOLEAN,
required: false required: false
},
{
name: "tts",
description: "Send with TTS?",
type: ApplicationCommandOptionType.BOOLEAN,
required: false
} }
], ],
@ -133,17 +139,16 @@ export default definePlugin({
Native.executeWebhook("" + webhookUrl, { Native.executeWebhook("" + webhookUrl, {
webhookMessage webhookMessage
}); });
} }
else { else {
Native.executeWebhook("" + webhookUrl, { Native.executeWebhook("" + webhookUrl, {
content: webhookMessage, content: webhookMessage,
username: webhookUsername ?? fetch("" + webhookUrl).then(response => response.json()), username: webhookUsername ?? fetch("" + webhookUrl).then(response => response.json()),
avatar_url: "" avatar_url: "",
tts: findOption(option, "tts")
}); });
} }
sendBotMessage(ctx.channel.id, { sendBotMessage(ctx.channel.id, {
content: "Message sent successfully." content: "Message sent successfully."
}); });