AuditLog Event for member timeouts.

Currently, I have this code to see what it gives me in return:
if(!oldMember.isCommunicationDisabled() && newMember.isCommunicationDisabled()) {
await sleep(1000)
const fetchedLogs = await newMember.guild.fetchAuditLogs({
limit: 1,
type: AuditLogEvent.MemberUpdate,
user: newMember.user.id
})
console.log(fetchedLogs)
}
if(!oldMember.isCommunicationDisabled() && newMember.isCommunicationDisabled()) {
await sleep(1000)
const fetchedLogs = await newMember.guild.fetchAuditLogs({
limit: 1,
type: AuditLogEvent.MemberUpdate,
user: newMember.user.id
})
console.log(fetchedLogs)
}
But I get nothing
GuildAuditLogs {
webhooks: Collection(0) [Map] {},
integrations: Collection(0) [Map] {},
guildScheduledEvents: Collection(0) [Map] {},
applicationCommands: Collection(0) [Map] {},
autoModerationRules: Collection(0) [Map] {},
entries: Collection(0) [Map] {}
}
GuildAuditLogs {
webhooks: Collection(0) [Map] {},
integrations: Collection(0) [Map] {},
guildScheduledEvents: Collection(0) [Map] {},
applicationCommands: Collection(0) [Map] {},
autoModerationRules: Collection(0) [Map] {},
entries: Collection(0) [Map] {}
}
Not exactly sure if I don't have an intent enabled or something else
3 Replies
d.js toolkit
d.js toolkit2mo 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
İspik
İspik2mo ago
Ok so, I think the issue comes within Intents. I use IntentsBitField.Flags, works well enough with typescript, but it seems to have issues in Javascript
No description
İspik
İspik2mo ago
Unresolved variable GuildMembers for example. Right now I'm changing some stuff instead of IntentsBitField I will be using GatewayIntentBits and don't use an .add Welp, that didd nothing anyways :monbreyFacepalm: Yeah it works now. Thanks
Want results from more Discord servers?
Add your server