How to search through auditlog targets

how to search through auditlogs targets, I'm using this code:
const fetchedLogs = await <guild>.fetchAuditLogs({
limit: 1,
type: AuditLogEvent.MemberRoleUpdate,
}).catch(err => { console.log(err) });
const RoleLog = fetchedLogs.entries.first();
tt = RoleLog.changes.filter(t => t.key == `$add`) && RoleLog.target.filter(u => u.id == `userid`);
console.log(tt);
const fetchedLogs = await <guild>.fetchAuditLogs({
limit: 1,
type: AuditLogEvent.MemberRoleUpdate,
}).catch(err => { console.log(err) });
const RoleLog = fetchedLogs.entries.first();
tt = RoleLog.changes.filter(t => t.key == `$add`) && RoleLog.target.filter(u => u.id == `userid`);
console.log(tt);
but RoleLog.target.filter is not a function
1 Reply
d.js toolkit
d.js toolkit9mo 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