diff --git a/index.js b/index.js index 03c0bfc3f3d5bdbded989f1d6183fb78ad9f79ca..5630939c484b56b7b062a7938e45495a6ce2c35e 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);