From 14ac736f54952e1d93168cd50cda259490646c7a Mon Sep 17 00:00:00 2001 From: Louis Mazin Date: Thu, 16 Apr 2026 00:08:36 +0200 Subject: [PATCH] test --- index.js | 21 ++++++++++++--------- src/pterodactyl/displayer.js | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 884587e..a05b2a8 100644 --- a/index.js +++ b/index.js @@ -6,14 +6,17 @@ const update = require('./src/pterodactyl/displayer.js'); const clean = require('./src/pterodactyl/cleaner.js'); const { Client, GatewayIntentBits, Collection, Events, Partials } = require('discord.js'); -const client = new Client({ intents: - [ - GatewayIntentBits.GuildMembers, - GatewayIntentBits.GuildMessages, - GatewayIntentBits.GuildMessageReactions, - GatewayIntentBits.MessageContent, - GatewayIntentBits.Guilds - ], +const intents = [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions]; + +if (process.env.ENABLE_GUILD_MEMBERS_INTENT === 'true') { + intents.push(GatewayIntentBits.GuildMembers); +} + +if (process.env.ENABLE_MESSAGE_CONTENT_INTENT === 'true') { + intents.push(GatewayIntentBits.MessageContent); +} + +const client = new Client({ intents, partials: [Partials.Message, Partials.Channel, Partials.Reaction, Partials.User], }); @@ -87,4 +90,4 @@ client.on(Events.InteractionCreate, async interaction => { client.login(process.env.DISCORD_TOKEN); -setInterval(()=>{update(headers,numbers,client,process.env.PALWORLD_API_TOKEN)}, 120000); \ No newline at end of file +setInterval(() => { update(headers, client); }, 120000); \ No newline at end of file diff --git a/src/pterodactyl/displayer.js b/src/pterodactyl/displayer.js index 70d7c5e..f3258d6 100644 --- a/src/pterodactyl/displayer.js +++ b/src/pterodactyl/displayer.js @@ -125,7 +125,7 @@ const resolvePanelMessage = async (client, channelId, messageId) => { return { channel, message: newMessage }; }; -const update = async (headers, numbers, client, token) => { +const update = async (headers, client) => { try { const channelId = process.env.DISPLAYER_CHANNEL_ID; const messageId = process.env.DISPLAYER_MESSAGE_ID;