From 1dc98721ee622d3b955fce8923e8035eda3badbd Mon Sep 17 00:00:00 2001
From: byron <47872200+byeoon@users.noreply.github.com>
Date: Mon, 8 Apr 2024 20:52:50 -0400
Subject: [PATCH] Instead of logging to console when there's an error, log it
to the webhook message, also fixes to the README
---
src/plugins/WebhookManager/README.MD | 26 ++++++++++++--------------
src/plugins/WebhookManager/index.tsx | 6 ++----
2 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/src/plugins/WebhookManager/README.MD b/src/plugins/WebhookManager/README.MD
index 245c51875..c50fd759b 100644
--- a/src/plugins/WebhookManager/README.MD
+++ b/src/plugins/WebhookManager/README.MD
@@ -1,7 +1,6 @@
-
-
WebhookManager
+# WebhookManager
Manage your webhooks easily; delete, send messages, get detailed info and more.
-
+
## Commands
- /webhook send - *Sends a message through a webhook.*
@@ -9,16 +8,15 @@
- /webhook delete - *Deletes a webhook.*
-
+
- /webhook info - *Gets advanced details on the webhook such as the name, profile pic, server and channel ID, and additionally, information on person who created it*
Full /webhookinfo Output
- - Webhook Username
- - Webhook ID
- - Webhook Token
- - Channel ID
- - Server ID
- - Webhook Profile Picture
- - Webhook Type
- - Creator Profile
- - Creator UserID
-
\ No newline at end of file
+ - Webhook Username
+ - Webhook ID
+ - Webhook Token
+ - Channel ID
+ - Server ID
+ - Webhook Profile Picture
+ - Webhook Type
+ - Creator Profile
+
diff --git a/src/plugins/WebhookManager/index.tsx b/src/plugins/WebhookManager/index.tsx
index f8e114e12..fccef8dbf 100644
--- a/src/plugins/WebhookManager/index.tsx
+++ b/src/plugins/WebhookManager/index.tsx
@@ -40,16 +40,14 @@ export default definePlugin({
});
}
else {
- WMLogger.error("WebhookManager encountered an error deleting a webhook. " + res.status);
sendBotMessage(ctx.channel.id, {
- content: "There was an error deleting the webhook. Check the console for more info."
+ content: "There was an error with deleting the webhook, error code: " + res.status
});
}
}
catch (error) {
- WMLogger.error("WebhookManager encountered an error deleting a webhook. " + error);
sendBotMessage(ctx.channel.id, {
- content: "There was an error deleting the webhook. Check the console for more info. Did you input a valid webhook URL?"
+ content: "There was an error deleting the webhook. Did you input a valid webhook URL? Error: " + error
});
}
}