From d26db2d970a67979e23a513402121e873d2483bf Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 9 Sep 2020 22:09:34 -0400 Subject: [PATCH] add staff ID to notes --- src/commands/addnote.ts | 3 ++- src/commands/members.ts | 1 - src/commands/notes.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/addnote.ts b/src/commands/addnote.ts index 0e2a92b..9b82861 100644 --- a/src/commands/addnote.ts +++ b/src/commands/addnote.ts @@ -18,9 +18,10 @@ export default class AddNote extends Command { const member = this.client.util.resolveMember(args[0], this.mainGuild); if (!member) return this.error(message.channel, 'The member you specified could not be found.'); - const note: { userID?: string, date: Date, category?: string, text?: string } = { + const note: { userID?: string, staffID: string, date: Date, category?: string, text?: string } = { userID: member.user.id, date: new Date(), + staffID: message.author.id, }; if (args[args.length - 1] !== 'edu' && args[args.length - 1] !== 'comm' && args[args.length - 1] !== 'cs') { note.category = ''; diff --git a/src/commands/members.ts b/src/commands/members.ts index d877594..25902f1 100644 --- a/src/commands/members.ts +++ b/src/commands/members.ts @@ -1,7 +1,6 @@ import { Message } from 'eris'; import { createPaginationEmbed } from 'eris-pagination'; import { Client, Command, RichEmbed } from '../class'; -import { members } from '.'; export default class Members extends Command { constructor(client: Client) { diff --git a/src/commands/notes.ts b/src/commands/notes.ts index 98b8c31..5f81fb2 100644 --- a/src/commands/notes.ts +++ b/src/commands/notes.ts @@ -29,7 +29,7 @@ export default class Notes extends Command { case 'comm': for (const note of notes.sort((a, b) => b.date.getTime() - a.date.getTime()).filter((r) => r.category === 'comm')) { noteArray.push({ - name: `${note._id}${note.category === '' ? '' : `, ${note.category}`} | ${note.date.toLocaleString('en-us')} ET`, + name: `${note._id}${note.category === '' ? '' : `, ${note.category.toUpperCase()}`} | ${note.date.toLocaleString('en-us')} ET | Staff: ${this.client.users.get(note.staffID) ? `${this.client.users.get(note.staffID).username}#${this.client.users.get(note.staffID).discriminator}` : 'N/A'}`, value: note.text, inline: true, }); @@ -38,7 +38,7 @@ export default class Notes extends Command { case 'cs': for (const note of notes.sort((a, b) => b.date.getTime() - a.date.getTime()).filter((r) => r.category === 'cs')) { noteArray.push({ - name: `${note._id}${note.category === '' ? '' : `, ${note.category}`} | ${note.date.toLocaleString('en-us')} ET`, + name: `${note._id}${note.category === '' ? '' : `, ${note.category.toUpperCase()}`} | ${note.date.toLocaleString('en-us')} ET | Staff: ${this.client.users.get(note.staffID) ? `${this.client.users.get(note.staffID).username}#${this.client.users.get(note.staffID).discriminator}` : 'N/A'}`, value: note.text, inline: true, }); @@ -47,7 +47,7 @@ export default class Notes extends Command { case 'edu': for (const note of notes.sort((a, b) => b.date.getTime() - a.date.getTime()).filter((r) => r.category === 'edu')) { noteArray.push({ - name: `${note._id}${note.category === '' ? '' : `, ${note.category}`}} | ${note.date.toLocaleString('en-us')} ET`, + name: `${note._id}${note.category === '' ? '' : `, ${note.category.toUpperCase()}`}} | ${note.date.toLocaleString('en-us')} ET | Staff: Staff: ${this.client.users.get(note.staffID) ? `${this.client.users.get(note.staffID).username}#${this.client.users.get(note.staffID).discriminator}` : 'N/A'}`, value: note.text, inline: true, });