From 8203ee1d3967a225220ccd826db15be7d802a54b Mon Sep 17 00:00:00 2001 From: Tarrgon <61888458+Tarrgon@users.noreply.github.com> Date: Wed, 10 Sep 2025 18:27:54 -0400 Subject: [PATCH] Small fix to notes --- src/commands/notes.ts | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/commands/notes.ts b/src/commands/notes.ts index 083f5ce..e2e1291 100644 --- a/src/commands/notes.ts +++ b/src/commands/notes.ts @@ -109,10 +109,15 @@ export default { timestamp: new Date(), fields: [ { - name: 'User', + name: 'Moderator', value: `<@${interaction.user.id}>\n${interaction.user.username}`, inline: true }, + { + name: 'User', + value: `<@${user.id}>\n${user.username}`, + inline: true + }, { name: 'Note', value: reason, @@ -121,13 +126,13 @@ export default { ] }); - await Database.putNote(idToUse, reason, interaction.user.id); + await Database.putNote(user.id, reason, interaction.user.id); - interaction.editReply(`Note added to <@${idToUse}>.\n\nReason:\n${reason}`); + interaction.editReply(`Note added to <@${user.id}>.\n\nReason:\n${reason}`); } else if (subcommand == 'remove') { const noteId = interaction.options.getInteger('note', true); - const notes = await Database.getNotes(idToUse); + const notes = await Database.getNotes(user.id); const note = notes.find(n => n.id == noteId); if (!note) return interaction.editReply('Note not found.'); @@ -139,10 +144,15 @@ export default { timestamp: new Date(), fields: [ { - name: 'User', + name: 'Moderator', value: `<@${interaction.user.id}>\n${interaction.user.username}`, inline: true }, + { + name: 'User', + value: `<@${user.id}>\n${user.username}`, + inline: true + }, { name: 'Note', value: `${note.reason}\nBy: <@${note.mod_id}>`, @@ -156,7 +166,7 @@ export default { } else if (subcommand == 'edit') { const noteId = interaction.options.getInteger('note', true); - const notes = await Database.getNotes(idToUse); + const notes = await Database.getNotes(user.id); const note = notes.find(n => n.id == noteId); if (!note) return interaction.editReply('Note not found.'); @@ -170,10 +180,15 @@ export default { timestamp: new Date(), fields: [ { - name: 'User', + name: 'Moderator', value: `<@${interaction.user.id}>\n${interaction.user.username}`, inline: true }, + { + name: 'User', + value: `<@${user.id}>\n${user.username}`, + inline: true + }, { name: 'Old reason', value: note.reason @@ -188,11 +203,11 @@ export default { await Database.editNote(noteId, note.reason, reason, interaction.user.id); - interaction.editReply(`Note on <@${idToUse}> edited.\n\nNew reason:\n${reason}`); + interaction.editReply(`Note on <@${user.id}> edited.\n\nNew reason:\n${reason}`); } else if (subcommand == 'list') { - const noteMessage = await getNoteMessage(idToUse, 1); + const noteMessage = await getNoteMessage(user.id, 1); - if (!noteMessage) return interaction.editReply(`No notes found for <@${idToUse}>`); + if (!noteMessage) return interaction.editReply(`No notes found for <@${user.id}>`); interaction.editReply(noteMessage); }