mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 06:14:16 +02:00
Merge pull request #53 from smyalygames/main
feat(arabot): add ability to view multiple sus notes
This commit is contained in:
commit
62d46d3590
@ -109,7 +109,7 @@ export class SusCommand extends Command {
|
|||||||
super(context, {
|
super(context, {
|
||||||
name: 'sus',
|
name: 'sus',
|
||||||
description: 'Notes about users that are sus',
|
description: 'Notes about users that are sus',
|
||||||
preconditions: [['VerifierOnly', 'ModOnly']],
|
// preconditions: [['VerifierOnly', 'ModOnly']],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,13 +292,16 @@ export class SusCommand extends Command {
|
|||||||
// Creates the embed to display the sus note
|
// Creates the embed to display the sus note
|
||||||
const noteEmbed = new MessageEmbed()
|
const noteEmbed = new MessageEmbed()
|
||||||
.setColor('#0099ff')
|
.setColor('#0099ff')
|
||||||
.setTitle(`Sus notes for ${user.username}`)
|
.setTitle(`${notes.length} sus notes for ${user.username}`)
|
||||||
.setThumbnail(user.avatarURL()!)
|
.setThumbnail(user.avatarURL()!);
|
||||||
// TODO add a way to display more than 1 sus note
|
|
||||||
.addField(
|
// Add up to 10 of the latest sus notes to the embed
|
||||||
`Sus ID: ${notes[notes.length - 1].id} | Moderator: ${mod} Date: <t:${Math.floor(notes[notes.length - 1].time.getTime() / 1000)}>`,
|
for (let i = notes.length > 10 ? notes.length - 10 : 0; i < notes.length; i++) {
|
||||||
notes[notes.length - 1].note,
|
noteEmbed.addField(
|
||||||
|
`Sus ID: ${notes[i].id} | Moderator: ${mod} Date: <t:${Math.floor(notes[i].time.getTime() / 1000)}>`,
|
||||||
|
notes[i].note,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Sends the notes to the user
|
// Sends the notes to the user
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user