test
This commit is contained in:
parent
eeddb97523
commit
14ac736f54
21
index.js
21
index.js
@ -6,14 +6,17 @@ const update = require('./src/pterodactyl/displayer.js');
|
|||||||
const clean = require('./src/pterodactyl/cleaner.js');
|
const clean = require('./src/pterodactyl/cleaner.js');
|
||||||
const { Client, GatewayIntentBits, Collection, Events, Partials } = require('discord.js');
|
const { Client, GatewayIntentBits, Collection, Events, Partials } = require('discord.js');
|
||||||
|
|
||||||
const client = new Client({ intents:
|
const intents = [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions];
|
||||||
[
|
|
||||||
GatewayIntentBits.GuildMembers,
|
if (process.env.ENABLE_GUILD_MEMBERS_INTENT === 'true') {
|
||||||
GatewayIntentBits.GuildMessages,
|
intents.push(GatewayIntentBits.GuildMembers);
|
||||||
GatewayIntentBits.GuildMessageReactions,
|
}
|
||||||
GatewayIntentBits.MessageContent,
|
|
||||||
GatewayIntentBits.Guilds
|
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],
|
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);
|
client.login(process.env.DISCORD_TOKEN);
|
||||||
|
|
||||||
setInterval(()=>{update(headers,numbers,client,process.env.PALWORLD_API_TOKEN)}, 120000);
|
setInterval(() => { update(headers, client); }, 120000);
|
||||||
@ -125,7 +125,7 @@ const resolvePanelMessage = async (client, channelId, messageId) => {
|
|||||||
return { channel, message: newMessage };
|
return { channel, message: newMessage };
|
||||||
};
|
};
|
||||||
|
|
||||||
const update = async (headers, numbers, client, token) => {
|
const update = async (headers, client) => {
|
||||||
try {
|
try {
|
||||||
const channelId = process.env.DISPLAYER_CHANNEL_ID;
|
const channelId = process.env.DISPLAYER_CHANNEL_ID;
|
||||||
const messageId = process.env.DISPLAYER_MESSAGE_ID;
|
const messageId = process.env.DISPLAYER_MESSAGE_ID;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user