mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-20 06:30:35 +00:00
handle if there is no profile pic option, also making it string only because compatibility issues
This commit is contained in:
parent
1947cedd55
commit
2ac335c3f4
1 changed files with 7 additions and 3 deletions
|
@ -126,8 +126,8 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "pfp",
|
name: "pfp",
|
||||||
description: "Send with a custom profile picture.",
|
description: "Send with a custom profile picture. You must input a valid image URL.",
|
||||||
type: ApplicationCommandOptionType.ATTACHMENT,
|
type: ApplicationCommandOptionType.STRING,
|
||||||
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 webhookProfilePic = findOption(option, "pfp");
|
let 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, {
|
||||||
|
@ -153,6 +153,10 @@ export default definePlugin({
|
||||||
webhookUsername = undefined;
|
webhookUsername = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (webhookProfilePic === "") {
|
||||||
|
webhookProfilePic = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
Native.executeWebhook("" + webhookUrl, {
|
Native.executeWebhook("" + webhookUrl, {
|
||||||
content: webhookMessage,
|
content: webhookMessage,
|
||||||
username: webhookUsername,
|
username: webhookUsername,
|
||||||
|
|
Loading…
Reference in a new issue