Zaenalos
Zaenalos
DIAdiscord.js - Imagine an app
Created by Zaenalos on 12/10/2023 in #djs-questions
Bot doesn't reply, DJS v14
Index.js
const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, GatewayIntentBits, Partials } = require('discord.js');
const { token } = require('./config.json'); const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildPresences, GatewayIntentBits.MessageContent, GatewayIntentBits.DirectMessages],
partials: [Partials.Channel]
});
const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, GatewayIntentBits, Partials } = require('discord.js');
const { token } = require('./config.json'); const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildPresences, GatewayIntentBits.MessageContent, GatewayIntentBits.DirectMessages],
partials: [Partials.Channel]
});
the console.log works but the bot doesn't reply. Message handling.
module.exports = {
name: 'messageCreate',
execute(message) {
console.log(`Received a message from ${message.author.tag}: ${message.content}`);

if (message.author.bot) return;

if (message.channel.type === 'dm' && message.content === '!hi') {
message.author.send('Hello!');
}
},
};
module.exports = {
name: 'messageCreate',
execute(message) {
console.log(`Received a message from ${message.author.tag}: ${message.content}`);

if (message.author.bot) return;

if (message.channel.type === 'dm' && message.content === '!hi') {
message.author.send('Hello!');
}
},
};
23 replies
DIAdiscord.js - Imagine an app
Created by Zaenalos on 6/7/2023 in #djs-questions
Ping NaNms
34 replies