前提
discord.jsでbotを作っています。
実現したいこと
flagsのエラーを解決したい。
発生している問題・エラーメッセージ
TypeError:Cannot read properties of undefined (reading 'FLAGS')
該当のソースコード
js
1const discord = require('discord.js'); 2const bot = new discord.Client({ intents: Object.values(discord.Intents.FLAGS) }); 3bot.on('ready', async () => { 4 console.log(`${bot.user.tag}にログインしました`); 5}) 6bot.on('messageCreate', async msg => { 7 if (msg.author.bot) { 8 return; 9 } 10 if (msg.content === '!ping') { 11 msg.channel.send('test'); 12 } 13}) 14bot.login(process.env.TOKEN);
試したこと
js
1const {Client, Intents} = require('discord.js');
補足情報(FW/ツールのバージョンなど)
Replitで実行