3 Replies
- 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 staff-- [email protected]
kind of not helpful i think
uh
Its like i want to know my messageUpdate event does not triggers
still.
on using messageUpdate to
the event not working
or i have to log raw ?
edit message
Yes
message in a server where bot has administrator permissions
yes it performs other functions
Nevermind
sorry
i was trying it in other server
i actually noticed it now
const { Client, Collection, Partials, GatewayIntentBits } = require('discord.js')
const client = new Client({
partials: [Partials.Message],
intents: [GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildPresences]
})
const fs = require('fs')
client.commands = new Collection();
client.aliases = new Collection();
client.slashcommands = new Collection();
const handlers = fs.readdirSync(__dirname + '/handlers').filter(handler => handler.endsWith('.js'))
handlers.forEach(handler => {
require(__dirname + `/handlers/${handler}`)(client)
})
client.login(require('./config/bot.json').token)
// require('./database/loader')
const cron = require('node-cron');
// Schedule the task to run every day at midnight (12:00 AM)
cron.schedule('0 0 0 * * *', () => {
console.log('Running task at midnight');
runDailyTask();
}, {
timezone: require('./config/slot.json').timezone// Set the timezone to your desired timezone
});
async function runDailyTask() {
const data = await require('./database/loader').slotsFile;
for (let i = 0; i < data.length; i++) {
data[i].pings.here = 0;
data[i].pings.everyone = 0;
}
fs.writeFileSync(__dirname + "/database/slots.json", JSON.stringify(data));
console.log('Ping reset successfully')
}
client.on('updateMessage', async (oldMessage, newMessage) => {
console.log(oldMessage, newMessage)
});
const { Client, Collection, Partials, GatewayIntentBits } = require('discord.js')
const client = new Client({
partials: [Partials.Message],
intents: [GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildPresences]
})
const fs = require('fs')
client.commands = new Collection();
client.aliases = new Collection();
client.slashcommands = new Collection();
const handlers = fs.readdirSync(__dirname + '/handlers').filter(handler => handler.endsWith('.js'))
handlers.forEach(handler => {
require(__dirname + `/handlers/${handler}`)(client)
})
client.login(require('./config/bot.json').token)
// require('./database/loader')
const cron = require('node-cron');
// Schedule the task to run every day at midnight (12:00 AM)
cron.schedule('0 0 0 * * *', () => {
console.log('Running task at midnight');
runDailyTask();
}, {
timezone: require('./config/slot.json').timezone// Set the timezone to your desired timezone
});
async function runDailyTask() {
const data = await require('./database/loader').slotsFile;
for (let i = 0; i < data.length; i++) {
data[i].pings.here = 0;
data[i].pings.everyone = 0;
}
fs.writeFileSync(__dirname + "/database/slots.json", JSON.stringify(data));
console.log('Ping reset successfully')
}
client.on('updateMessage', async (oldMessage, newMessage) => {
console.log(oldMessage, newMessage)
});
const { Client, Collection, Partials, GatewayIntentBits } = require('discord.js')
const client = new Client({
partials: [Partials.Message],
intents: [GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildPresences]
})
const fs = require('fs')
client.commands = new Collection();
client.aliases = new Collection();
client.slashcommands = new Collection();
const handlers = fs.readdirSync(__dirname + '/handlers').filter(handler => handler.endsWith('.js'))
handlers.forEach(handler => {
require(__dirname + `/handlers/${handler}`)(client)
})
client.login(require('./config/bot.json').token)
// require('./database/loader')
const cron = require('node-cron');
// Schedule the task to run every day at midnight (12:00 AM)
cron.schedule('0 0 0 * * *', () => {
console.log('Running task at midnight');
runDailyTask();
}, {
timezone: require('./config/slot.json').timezone// Set the timezone to your desired timezone
});
async function runDailyTask() {
const data = await require('./database/loader').slotsFile;
for (let i = 0; i < data.length; i++) {
data[i].pings.here = 0;
data[i].pings.everyone = 0;
}
fs.writeFileSync(__dirname + "/database/slots.json", JSON.stringify(data));
console.log('Ping reset successfully')
}
client.on('messageUpdate', async (oldMessage, newMessage) => {
console.log(oldMessage, newMessage)
});
client.on("raw", help => {
console.log(help)
})
const { Client, Collection, Partials, GatewayIntentBits } = require('discord.js')
const client = new Client({
partials: [Partials.Message],
intents: [GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildPresences]
})
const fs = require('fs')
client.commands = new Collection();
client.aliases = new Collection();
client.slashcommands = new Collection();
const handlers = fs.readdirSync(__dirname + '/handlers').filter(handler => handler.endsWith('.js'))
handlers.forEach(handler => {
require(__dirname + `/handlers/${handler}`)(client)
})
client.login(require('./config/bot.json').token)
// require('./database/loader')
const cron = require('node-cron');
// Schedule the task to run every day at midnight (12:00 AM)
cron.schedule('0 0 0 * * *', () => {
console.log('Running task at midnight');
runDailyTask();
}, {
timezone: require('./config/slot.json').timezone// Set the timezone to your desired timezone
});
async function runDailyTask() {
const data = await require('./database/loader').slotsFile;
for (let i = 0; i < data.length; i++) {
data[i].pings.here = 0;
data[i].pings.everyone = 0;
}
fs.writeFileSync(__dirname + "/database/slots.json", JSON.stringify(data));
console.log('Ping reset successfully')
}
client.on('messageUpdate', async (oldMessage, newMessage) => {
console.log(oldMessage, newMessage)
});
client.on("raw", help => {
console.log(help)
})