From d6b892f47cec128c65a331c21e5acba1f72b4dc3 Mon Sep 17 00:00:00 2001
From: SofianeLasri <alasri250@gmail.com>
Date: Thu, 13 Oct 2022 10:43:00 +0200
Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20du=20bot=20pour=20qu'il?=
 =?UTF-8?q?=20puisse=20fonctionner=20avec=20le=20nouveau=20syst=C3=A8me=20?=
 =?UTF-8?q?d'intent.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .env     | 16 ++++++++++++++++
 index.js | 11 +++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100644 .env

diff --git a/.env b/.env
new file mode 100644
index 0000000..1337830
--- /dev/null
+++ b/.env
@@ -0,0 +1,16 @@
+DISCORD_BOT_TOKEN=ODMwMzYwOTA5NTE1OTgwODEw.GT6S6x.lJSvZrNElmyFOO612WVyiNpxzxHhnglVl4oG60
+CLIENT_ID=830360909515980810
+GUILD_ID=815138534704939039
+BDD_HOST=node.sl-projects.com
+BDD_NAME=srvMinecraft
+BDD_USER=srvMinecraft
+BDD_PASSWORD=YIn2hTln5iMQap1W
+ROLE_ANNIV=949734406409556038
+ROLE_ADMIN=830359225972162561
+
+CANAL_GENERAL=815138535413121056
+CANAL_LOG=830362795588452363
+CANAL_CHAT_MC=950009038291222589
+CANAL_CHAT_MC_DEV=830362795588452363
+
+PORT_MSG_SRVMC=25575
\ No newline at end of file
diff --git a/index.js b/index.js
index af8c018..a850c47 100644
--- a/index.js
+++ b/index.js
@@ -276,11 +276,18 @@ recursiveAsyncReadLine(); //we have to actually start our recursion somehow
 // BOT DISCORD
 ////////////////////////////////////////////////////////////////
 // require the needed discord.js classes
-const { Client, Intents, MessageActionRow, MessageButton, WebhookClient } = require('discord.js');
+const { Client, GatewayIntentBits, MessageActionRow, MessageButton, WebhookClient } = require('discord.js');
 const { verify } = require('crypto');
 
 // create a new Discord client
-const client = new Client({ intents: ["GUILDS", "GUILD_MESSAGES", "DIRECT_MESSAGES", "GUILD_MEMBERS"] });
+const client = new Client({
+    intents: [
+        GatewayIntentBits.Guilds,
+        GatewayIntentBits.GuildMessages,
+        GatewayIntentBits.GuildMembers,
+        GatewayIntentBits.DirectMessages
+    ]
+})
 var mcChatWebhook, devMcChatWebhook;
 
 client.on("ready", async function () {
-- 
GitLab