consts and requirements
require('dotenv').config();
const OpenAI = require('openai-api');
// Load your key from an environment variable or secret management service
// (do not include your key directly in your code)
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
const openai = new OpenAI(OPENAI_API_KEY);
const Discord = require('discord.js');
const TOKEN = process.env.TOKEN;
const { Client, Intents } = require('discord.js');
const bot = new Discord.Client({ intents: [Intents.FLAGS.GUILDS] });
const prefix = 'w!';
*on ready*
bot.on('ready', async() => {
console.log(`${bot.user.tag} is online!`);
bot.user.setActivity('with the code', {type: 'PLAYING'});
});
this is the one being the problem, it won't detect sent messages I've tried a few different ways but nothing, got nothing to do with the server permissions I'm testing on a blank server and node is up to date
bot.on('messageCreate', message => {
if (message.content === 'ping') {
message.channel.send('pong');
}
});