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'>
<h1> WebhookManager </h1>
# WebhookManager
Manage your webhooks easily; delete, send messages, get detailed info and more.
</div>
## 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*
<details><summary>Full /webhookinfo Output</summary>
- Webhook Username <br>
- Webhook ID<br>
- Webhook Token<br>
- Channel ID<br>
- Server ID<br>
- Webhook Profile Picture<br>
- Webhook Type<br>
- Creator Profile<br>
- Creator UserID<br>
</details>
- Webhook Username
- Webhook ID
- Webhook Token
- Channel ID
- Server ID
- Webhook Profile Picture
- Webhook Type
- Creator Profile
</details>

View file

@ -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
});
}
}