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 { 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);
|
||||
setInterval(() => { update(headers, client); }, 120000);
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user