help create my discord bot on nodejs and discord.js

my code require('dotenv').config(); const { Client, Intents } = require('discord.js'); const client = new Client({ intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ] }); const { YoutubeNotifier } = require('discord-bot-youtube-notifications'); const notifier = new YoutubeNotifier({ youtubeApiKey: process.env.YOUTUBE_API_KEY, discordClient: client, channel: process.env.CHAT_ID, }); client.on('ready', () => { console.log('Application start!') notifier.start(); }); client.login(process.env.SECRET_TOKEN);
No description
7 Replies
d.js toolkit
d.js toolkit7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
monbrey
monbrey7mo ago
You are using v13 code while having v14 installed it seems Not sure where you got this from
DANYA TARAKUN
DANYA TARAKUN7mo ago
please help
d.js docs
d.js docs7mo ago
Tag suggestion for @hydrovskiy: RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined - All SCREAMING_SNAKE_CASE enums have been changed to PascalCase - Intents: Intents.FLAGS.GUILD_MESSAGES -> GatewayIntentBits.GuildMessages - Permissions: Permissions.FLAGS.SEND_MESSAGES -> PermissionFlagsBits.SendMessages
Someone
Someone7mo ago
Exactly what the previous helper said, check your discord.js version in package.json
DANYA TARAKUN
DANYA TARAKUN7mo ago
Help no need. This working
darp
darp7mo ago
then click "mark post as solved" button
Want results from more Discord servers?
Add your server