From ec6aa4d193d76e7fd4c56dc17ac6045229ee3e6d Mon Sep 17 00:00:00 2001 From: SofianeLasri <alasri250@gmail.com> Date: Sat, 9 Jul 2022 15:48:35 +0200 Subject: [PATCH] webhook.id, token: webhook.token --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 03c0bfc..5630939 100644 --- a/index.js +++ b/index.js @@ -594,7 +594,7 @@ async function checkAnniv() { async function verifyMcChatWebhook() { let mcChatWebhookId = await botSettings.findOne({ where: { name: "mcChatWebhookId" } }); let devMcChatWebhookId = await botSettings.findOne({ where: { name: "devMcChatWebhookId" } }); - + if (mcChatWebhookId != null && devMcChatWebhookId != null) { console.log("[" + 'INFO'.yellow + "] Le Webhook du serveur MC est déjà configuré."); let mcChatWebhookToken = await botSettings.findOne({ where: { name: "mcChatWebhookToken" } }); @@ -626,7 +626,7 @@ async function createMcChatWebhook() { name: "mcChatWebhookToken", value: webhook.token }); - mcChatWebhook = new WebhookClient({ id: mcChatWebhookId.value, token: mcChatWebhookToken.value }); + mcChatWebhook = new WebhookClient({ id: webhook.id, token: webhook.token }); console.log("[" + 'INFO'.yellow + "] Le Webhook du serveur MC a été configuré avec succès."); }) .catch(console.error); @@ -644,7 +644,7 @@ async function createMcChatWebhook() { name: "devMcChatWebhookToken", value: webhook.token }); - devMcChatWebhook = new WebhookClient({ id: devMcChatWebhookId.value, token: devMcChatWebhookToken.value }); + devMcChatWebhook = new WebhookClient({ id: webhook.id, token: webhook.token }); console.log("[" + 'INFO'.yellow + "] Le Webhook du serveur MC Dev a été configuré avec succès."); }) .catch(console.error); -- GitLab