kickas__
kickas__
DIAdiscord.js - Imagine an app
Created by kickas__ on 4/5/2024 in #djs-questions
Another problem again with chatgpt bot
I run index.js which I watched a whole video and nothing will pop up in powershell after running it
29 replies
DIAdiscord.js - Imagine an app
Created by kickas__ on 4/5/2024 in #djs-questions
Bot wont resond to dms (Yes I used ChatGPT)
const { Client, GatewayIntentBits } = require('discord.js'); // Create a new client instance with the necessary intents const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.DirectMessages, GatewayIntentBits.MessageContent] }); client.once('ready', () => { console.log('The bot is ready and logged in as ' + client.user.tag); }); client.on('messageCreate', message => { console.log(Received message from ${message.author.tag}: ${message.content});
// If the message is from a bot, ignore it if (message.author.bot) return; // Check if the message is a DM if (message.channel.type === 'DM') { message.reply('Hello! How can I help you today?') .then(() => console.log(Replied to message from ${message.author.tag})) .catch(console.error); } }); // Replace 'YOUR_BOT_TOKEN_HERE' with your bot's token client.login('HIDDEN');
75 replies