mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-19 22:20:34 +00:00
Ready for reviews / feedback
This commit is contained in:
parent
9fab41449a
commit
2da6a64748
1 changed files with 8 additions and 11 deletions
|
@ -90,7 +90,6 @@ export default definePlugin({
|
|||
sourceChannelGet = "";
|
||||
}
|
||||
sendBotMessage(ctx.channel.id, {
|
||||
|
||||
embeds: [
|
||||
{
|
||||
// @ts-ignore
|
||||
|
@ -141,25 +140,24 @@ export default definePlugin({
|
|||
type: ApplicationCommandOptionType.STRING,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: "rawjson",
|
||||
description: "Send message as raw JSON",
|
||||
type: ApplicationCommandOptionType.BOOLEAN,
|
||||
required: false
|
||||
},
|
||||
{
|
||||
name: "tts",
|
||||
description: "Send with TTS",
|
||||
type: ApplicationCommandOptionType.BOOLEAN,
|
||||
required: false
|
||||
},
|
||||
{
|
||||
name: "rawjson",
|
||||
description: "Send message as raw JSON",
|
||||
type: ApplicationCommandOptionType.BOOLEAN,
|
||||
required: false
|
||||
}
|
||||
|
||||
],
|
||||
execute: async (option, ctx) => {
|
||||
|
||||
const webhookUrl = findOption(option, "url");
|
||||
const webhookMessage = findOption(option, "message");
|
||||
const webhookUsername = findOption(option, "username");
|
||||
let webhookUsername = findOption(option, "username");
|
||||
if (findOption(option, "rawjson")) {
|
||||
Native.executeWebhook("" + webhookUrl, {
|
||||
webhookMessage
|
||||
|
@ -168,12 +166,11 @@ export default definePlugin({
|
|||
else {
|
||||
Native.executeWebhook("" + webhookUrl, {
|
||||
content: webhookMessage,
|
||||
username: webhookUsername ?? fetch("" + webhookUrl).then(response => response.json()),
|
||||
username: webhookUsername ?? fetch("" + webhookUrl).then(response => response.json().then(response => { response.name; })),
|
||||
avatar_url: "",
|
||||
tts: findOption(option, "tts")
|
||||
});
|
||||
}
|
||||
|
||||
sendBotMessage(ctx.channel.id, {
|
||||
content: "Message sent successfully."
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue