mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-19 22:20:34 +00:00
extra error handling - will add more later
This commit is contained in:
parent
720aaf6f3e
commit
13119c0b29
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue