change intents to use GatewayIntentBits
This commit is contained in:
parent
44f71c0e2c
commit
dab0aa4799
15
start.js
15
start.js
|
@ -1,13 +1,20 @@
|
||||||
#!/usr/bin/env -S node
|
#!/usr/bin/env -S node
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const Discord = require('discord.js');
|
const { Client, Collection, GatewayIntentBits } = require('discord.js');
|
||||||
const config = require('./config.json');
|
const config = require('./config.json');
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
console.log('Starting!');
|
console.log('Starting!');
|
||||||
const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`)) });
|
// const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`)) });
|
||||||
|
const client = new Client({
|
||||||
client.commands = new Discord.Collection();
|
intents: [
|
||||||
|
GatewayIntentBits.Guilds,
|
||||||
|
GatewayIntentBits.GuildMessages,
|
||||||
|
GatewayIntentBits.GuildPresences
|
||||||
|
]
|
||||||
|
});
|
||||||
|
// todo: move back to file
|
||||||
|
client.commands = new Collection();
|
||||||
fs.readdirSync('./commands')
|
fs.readdirSync('./commands')
|
||||||
.filter(file => file.endsWith('.js'))
|
.filter(file => file.endsWith('.js'))
|
||||||
.forEach(file => {
|
.forEach(file => {
|
||||||
|
|
Reference in New Issue