From dab0aa4799998d49eafa396f256750b69bfe28ed Mon Sep 17 00:00:00 2001 From: Sophie Marie Date: Tue, 6 Dec 2022 20:42:00 -0600 Subject: [PATCH] change intents to use GatewayIntentBits --- start.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/start.js b/start.js index 3c37ded..6c7b701 100755 --- a/start.js +++ b/start.js @@ -1,13 +1,20 @@ #!/usr/bin/env -S node const fs = require('fs'); -const Discord = require('discord.js'); +const { Client, Collection, GatewayIntentBits } = require('discord.js'); const config = require('./config.json'); require('dotenv').config(); console.log('Starting!'); -const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`)) }); - -client.commands = new Discord.Collection(); +// const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`)) }); +const client = new Client({ + intents: [ + GatewayIntentBits.Guilds, + GatewayIntentBits.GuildMessages, + GatewayIntentBits.GuildPresences + ] +}); +// todo: move back to file +client.commands = new Collection(); fs.readdirSync('./commands') .filter(file => file.endsWith('.js')) .forEach(file => {