mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-20 06:30:35 +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 = "";
|
sourceChannelGet = "";
|
||||||
}
|
}
|
||||||
sendBotMessage(ctx.channel.id, {
|
sendBotMessage(ctx.channel.id, {
|
||||||
|
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -141,25 +140,24 @@ export default definePlugin({
|
||||||
type: ApplicationCommandOptionType.STRING,
|
type: ApplicationCommandOptionType.STRING,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "rawjson",
|
|
||||||
description: "Send message as raw JSON",
|
|
||||||
type: ApplicationCommandOptionType.BOOLEAN,
|
|
||||||
required: false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "tts",
|
name: "tts",
|
||||||
description: "Send with TTS",
|
description: "Send with TTS",
|
||||||
type: ApplicationCommandOptionType.BOOLEAN,
|
type: ApplicationCommandOptionType.BOOLEAN,
|
||||||
required: false
|
required: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "rawjson",
|
||||||
|
description: "Send message as raw JSON",
|
||||||
|
type: ApplicationCommandOptionType.BOOLEAN,
|
||||||
|
required: false
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
execute: async (option, ctx) => {
|
execute: async (option, ctx) => {
|
||||||
|
|
||||||
const webhookUrl = findOption(option, "url");
|
const webhookUrl = findOption(option, "url");
|
||||||
const webhookMessage = findOption(option, "message");
|
const webhookMessage = findOption(option, "message");
|
||||||
const webhookUsername = findOption(option, "username");
|
let webhookUsername = findOption(option, "username");
|
||||||
if (findOption(option, "rawjson")) {
|
if (findOption(option, "rawjson")) {
|
||||||
Native.executeWebhook("" + webhookUrl, {
|
Native.executeWebhook("" + webhookUrl, {
|
||||||
webhookMessage
|
webhookMessage
|
||||||
|
@ -168,12 +166,11 @@ export default definePlugin({
|
||||||
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().then(response => { response.name; })),
|
||||||
avatar_url: "",
|
avatar_url: "",
|
||||||
tts: findOption(option, "tts")
|
tts: findOption(option, "tts")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
sendBotMessage(ctx.channel.id, {
|
sendBotMessage(ctx.channel.id, {
|
||||||
content: "Message sent successfully."
|
content: "Message sent successfully."
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue