diff --git a/src/plugins/WebhookManager/README.MD b/src/plugins/WebhookManager/README.MD
index 8089eabfc..5963c1893 100644
--- a/src/plugins/WebhookManager/README.MD
+++ b/src/plugins/WebhookManager/README.MD
@@ -21,5 +21,4 @@
- Webhook Type
- Creator UserID
- Creator Username
- - Creator Profile
\ No newline at end of file
diff --git a/src/plugins/WebhookManager/index.tsx b/src/plugins/WebhookManager/index.tsx
index 4ff94af2d..58790c21f 100644
--- a/src/plugins/WebhookManager/index.tsx
+++ b/src/plugins/WebhookManager/index.tsx
@@ -68,10 +68,10 @@ export default definePlugin({
}
],
execute: async (option, ctx) => {
- let webhookUrl = findOption(option, "url");
+ const webhookUrl = findOption(option, "url");
await fetch("" + webhookUrl).then(response => response.json())
.then(response => {
- console.log(JSON.stringify(response));
+ WMLogger.info(JSON.stringify(response));
sendBotMessage(ctx.channel.id, {
content: "# Webhook Information: \n" +
"Webhook Username: " + response.name + "\n " +
@@ -122,19 +122,19 @@ export default definePlugin({
],
execute: async (option, ctx) => {
- let webhookUrl = findOption(option, "url");
- let webhookMessage = findOption(option, "message");
- let webhookUsername = findOption(option, "username");
+ const webhookUrl = findOption(option, "url");
+ const webhookMessage = findOption(option, "message");
+ const webhookUsername = findOption(option, "username");
if (findOption(option, "rawjson")) {
Native.executeWebhook("" + webhookUrl, {
- webhookMessage // doubt it will work but it might, might clash with other options such as the username, but once i'm home i'll continue testing.
+ webhookMessage
});
}
else {
Native.executeWebhook("" + webhookUrl, {
content: webhookMessage,
- username: webhookUsername ?? fetch("" + webhookUrl).then(response => response.json()), // still may have issues, supposed to go to webhook name if a custom name is not set, ?? should be the right operator
+ username: webhookUsername ?? fetch("" + webhookUrl).then(response => response.json()),
avatar_url: ""
});
}