HARRY
HARRY
DIAdiscord.js - Imagine an app
Created by HARRY on 11/24/2023 in #djs-questions
messagereactionsadd with old messages
partials: [Partials.Message, Partials.Channel, Partials.Reaction],
partials: [Partials.Message, Partials.Channel, Partials.Reaction],
but still don't work with old messages
6 replies
DIAdiscord.js - Imagine an app
Created by HARRY on 11/24/2023 in #djs-questions
messagereactionsadd with old messages
simple version of my code
6 replies
DIAdiscord.js - Imagine an app
Created by HARRY on 11/24/2023 in #djs-questions
messagereactionsadd with old messages
require('dotenv').config();

const { Client, IntentsBitField, Partials} = require('discord.js');
const colors = require('../modules/colors');

const client = new Client({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.MessageContent,
IntentsBitField.Flags.GuildMessageReactions,
],
partials: [Partials.MESSAGE, Partials.CHANNEL, Partials.REACTION],
messageCacheMaxSize: 100,
});

client.on('ready', (c) => {
console.log(`${colors.whiteBackground} ${c.user.tag} is ready haha${colors.resetBackground}`);
})

client.on("messageReactionAdd", async (reaction, user) => {
// Ensure "test" is logged for every reaction
console.log('test');

// Fetch the message if it's a partial
if (reaction.partial) {
try {
await reaction.fetch();
} catch (error) {
console.error('Something went wrong when fetching the message: ', error);
return;
}
}

// Your reaction handling logic here
reaction.remove();
});



client.login(process.env.TOKEN);
require('dotenv').config();

const { Client, IntentsBitField, Partials} = require('discord.js');
const colors = require('../modules/colors');

const client = new Client({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.MessageContent,
IntentsBitField.Flags.GuildMessageReactions,
],
partials: [Partials.MESSAGE, Partials.CHANNEL, Partials.REACTION],
messageCacheMaxSize: 100,
});

client.on('ready', (c) => {
console.log(`${colors.whiteBackground} ${c.user.tag} is ready haha${colors.resetBackground}`);
})

client.on("messageReactionAdd", async (reaction, user) => {
// Ensure "test" is logged for every reaction
console.log('test');

// Fetch the message if it's a partial
if (reaction.partial) {
try {
await reaction.fetch();
} catch (error) {
console.error('Something went wrong when fetching the message: ', error);
return;
}
}

// Your reaction handling logic here
reaction.remove();
});



client.login(process.env.TOKEN);
6 replies
DIAdiscord.js - Imagine an app
Created by HARRY on 11/24/2023 in #djs-questions
Detect new reactions
thank u so much i saw it right now
11 replies
DIAdiscord.js - Imagine an app
Created by HARRY on 11/24/2023 in #djs-questions
Detect new reactions
so i don't know if i enabled it or no
11 replies
DIAdiscord.js - Imagine an app
Created by HARRY on 11/24/2023 in #djs-questions
Detect new reactions
i actually do this
const { Client, IntentsBitField, Partials, Events } = require('discord.js');
const eventHandler = require('./handlers/eventHandler');

const client = new Client({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.MessageContent,
],
partials: [Partials.Message, Partials.Channel, Partials.Reaction],
});
const { Client, IntentsBitField, Partials, Events } = require('discord.js');
const eventHandler = require('./handlers/eventHandler');

const client = new Client({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.MessageContent,
],
partials: [Partials.Message, Partials.Channel, Partials.Reaction],
});
11 replies
DIAdiscord.js - Imagine an app
Created by HARRY on 11/24/2023 in #djs-questions
Detect new reactions
how can i do that
11 replies
DIAdiscord.js - Imagine an app
Created by HARRY on 11/24/2023 in #djs-questions
Detect new reactions
i do that but still when i add reaction itest isn't logged
client.on("messageReactionAdd", async (reaction, user) => {
console.log('test');

});
client.on("messageReactionAdd", async (reaction, user) => {
console.log('test');

});
11 replies