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",
|
||||
description: "Send with a custom profile picture.",
|
||||
type: ApplicationCommandOptionType.ATTACHMENT,
|
||||
description: "Send with a custom profile picture. You must input a valid image URL.",
|
||||
type: ApplicationCommandOptionType.STRING,
|
||||
required: false
|
||||
},
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ export default definePlugin({
|
|||
|
||||
const webhookUrl = findOption(option, "url");
|
||||
const webhookMessage = findOption(option, "message");
|
||||
const webhookProfilePic = findOption(option, "pfp");
|
||||
let webhookProfilePic = findOption(option, "pfp");
|
||||
let webhookUsername = findOption(option, "username");
|
||||
if (findOption(option, "raw")) {
|
||||
Native.executeWebhook("" + webhookUrl, {
|
||||
|
@ -153,6 +153,10 @@ export default definePlugin({
|
|||
webhookUsername = undefined;
|
||||
}
|
||||
|
||||
if (webhookProfilePic === "") {
|
||||
webhookProfilePic = undefined;
|
||||
}
|
||||
|
||||
Native.executeWebhook("" + webhookUrl, {
|
||||
content: webhookMessage,
|
||||
username: webhookUsername,
|
||||
|
|
Loading…
Reference in a new issue