Instead of logging to console when there's an error, log it to the webhook message, also fixes to the README

This commit is contained in:
byron 2024-04-08 20:52:50 -04:00
parent bc64dd400a
commit 1dc98721ee
2 changed files with 14 additions and 18 deletions

View file

@ -1,7 +1,6 @@
<div align='center'> # WebhookManager
<h1> WebhookManager </h1>
Manage your webhooks easily; delete, send messages, get detailed info and more. Manage your webhooks easily; delete, send messages, get detailed info and more.
</div>
## Commands ## Commands
- /webhook send - *Sends a message through a webhook.* - /webhook send - *Sends a message through a webhook.*
@ -12,13 +11,12 @@
- /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* - /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*
<details><summary>Full /webhookinfo Output</summary> <details><summary>Full /webhookinfo Output</summary>
- Webhook Username <br> - Webhook Username
- Webhook ID<br> - Webhook ID
- Webhook Token<br> - Webhook Token
- Channel ID<br> - Channel ID
- Server ID<br> - Server ID
- Webhook Profile Picture<br> - Webhook Profile Picture
- Webhook Type<br> - Webhook Type
- Creator Profile<br> - Creator Profile
- Creator UserID<br>
</details> </details>

View file

@ -40,16 +40,14 @@ export default definePlugin({
}); });
} }
else { else {
WMLogger.error("WebhookManager encountered an error deleting a webhook. " + res.status);
sendBotMessage(ctx.channel.id, { 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) { catch (error) {
WMLogger.error("WebhookManager encountered an error deleting a webhook. " + error);
sendBotMessage(ctx.channel.id, { 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
}); });
} }
} }