add staff ID to notes

pull/29/head
Matthew 2020-09-09 22:09:34 -04:00
parent 09ccc22cbd
commit d26db2d970
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
3 changed files with 5 additions and 5 deletions

View File

@ -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 = '';

View File

@ -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) {

View File

@ -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,
});