add staff ID to notes
parent
09ccc22cbd
commit
d26db2d970
|
@ -18,9 +18,10 @@ export default class AddNote extends Command {
|
||||||
const member = this.client.util.resolveMember(args[0], this.mainGuild);
|
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.');
|
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,
|
userID: member.user.id,
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
|
staffID: message.author.id,
|
||||||
};
|
};
|
||||||
if (args[args.length - 1] !== 'edu' && args[args.length - 1] !== 'comm' && args[args.length - 1] !== 'cs') {
|
if (args[args.length - 1] !== 'edu' && args[args.length - 1] !== 'comm' && args[args.length - 1] !== 'cs') {
|
||||||
note.category = '';
|
note.category = '';
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { Message } from 'eris';
|
import { Message } from 'eris';
|
||||||
import { createPaginationEmbed } from 'eris-pagination';
|
import { createPaginationEmbed } from 'eris-pagination';
|
||||||
import { Client, Command, RichEmbed } from '../class';
|
import { Client, Command, RichEmbed } from '../class';
|
||||||
import { members } from '.';
|
|
||||||
|
|
||||||
export default class Members extends Command {
|
export default class Members extends Command {
|
||||||
constructor(client: Client) {
|
constructor(client: Client) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ export default class Notes extends Command {
|
||||||
case 'comm':
|
case 'comm':
|
||||||
for (const note of notes.sort((a, b) => b.date.getTime() - a.date.getTime()).filter((r) => r.category === 'comm')) {
|
for (const note of notes.sort((a, b) => b.date.getTime() - a.date.getTime()).filter((r) => r.category === 'comm')) {
|
||||||
noteArray.push({
|
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,
|
value: note.text,
|
||||||
inline: true,
|
inline: true,
|
||||||
});
|
});
|
||||||
|
@ -38,7 +38,7 @@ export default class Notes extends Command {
|
||||||
case 'cs':
|
case 'cs':
|
||||||
for (const note of notes.sort((a, b) => b.date.getTime() - a.date.getTime()).filter((r) => r.category === 'cs')) {
|
for (const note of notes.sort((a, b) => b.date.getTime() - a.date.getTime()).filter((r) => r.category === 'cs')) {
|
||||||
noteArray.push({
|
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,
|
value: note.text,
|
||||||
inline: true,
|
inline: true,
|
||||||
});
|
});
|
||||||
|
@ -47,7 +47,7 @@ export default class Notes extends Command {
|
||||||
case 'edu':
|
case 'edu':
|
||||||
for (const note of notes.sort((a, b) => b.date.getTime() - a.date.getTime()).filter((r) => r.category === 'edu')) {
|
for (const note of notes.sort((a, b) => b.date.getTime() - a.date.getTime()).filter((r) => r.category === 'edu')) {
|
||||||
noteArray.push({
|
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,
|
value: note.text,
|
||||||
inline: true,
|
inline: true,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue