b3ssel
b3ssel
DIAdiscord.js - Imagine an app
Created by b3ssel on 12/7/2023 in #djs-questions
Fetching the audit logs not returning as wanted
const kickWithinMinute = await guild.fetchAuditLogs({
type: AuditLogEvent.MemberKick,
after: auditLogEntry.createdTimestamp - 60_000
});
const kickWithinMinute = await guild.fetchAuditLogs({
type: AuditLogEvent.MemberKick,
after: auditLogEntry.createdTimestamp - 60_000
});
What do I need to change to the after: property to only fetch the logs from a minute ago? With this code snippet is returns the MemberKick audit logs that happened way earlier than 1 minute ago of the created audit log entry, like if that after property doesn't exist in the code.
19 replies
DIAdiscord.js - Imagine an app
Created by b3ssel on 12/4/2023 in #djs-questions
"ValidationError: Expected a string primitive" when adding options to a StringSelectMenuBuilder
Hey, got a question: I want to add a StringSelectMenuBuilder, and for the options I have this:
const optionsSSM = choices.slice(0, 22).map(choice => ({ name: choice, value: choice }));
// ...
const component = new StringSelectMenuBuilder({
custom_id: ...,
placeholder: ...,
options: optionsSSM
});
const optionsSSM = choices.slice(0, 22).map(choice => ({ name: choice, value: choice }));
// ...
const component = new StringSelectMenuBuilder({
custom_id: ...,
placeholder: ...,
options: optionsSSM
});
choices is an Array[] but when I do this later on in my code, I get the following error:
ValidationError: Expected a string primitive
when I log my optionsSSM in the console, I get this (which in my eyes is a valid format to the StringSelectMenuBuilder class):
[
{
name: 'choice1',
value: 'choice1'
},
{
name: 'choice2',
value: 'choice2'
},
{
name: 'choice3',
value: 'choice3'
},
// And so on
]
[
{
name: 'choice1',
value: 'choice1'
},
{
name: 'choice2',
value: 'choice2'
},
{
name: 'choice3',
value: 'choice3'
},
// And so on
]
6 replies