revert error change

This commit is contained in:
byron 2024-05-20 15:53:56 -04:00
parent 46e4fc664a
commit d29d5e9476

View file

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