diff --git a/src/plugins/WebhookManager/index.tsx b/src/plugins/WebhookManager/index.tsx index 86e603297..2e206a132 100644 --- a/src/plugins/WebhookManager/index.tsx +++ b/src/plugins/WebhookManager/index.tsx @@ -35,6 +35,12 @@ export default definePlugin({ await fetch("" + findOption(option, "url"), { method: "DELETE" }).then(() => sendBotMessage(ctx.channel.id, { content: "The webhook has deleted successfully." })); } catch (error) { + if (!["discord.com", "ptb.discord.com", "canary.discord.com"].includes(findOption(option, "url")) || !pathname.startsWith("/api/webhooks/")) { + sendBotMessage(ctx.channel.id, { + content: "Please input a valid webhook URL to delete." + }); + } + sendBotMessage(ctx.channel.id, { content: "There was an error deleting the webhook. Did you input a valid webhook URL? Error: " + error });