Merge branch 'dev'
commit
9b193abe97
|
@ -14,8 +14,10 @@ export default class Internal extends Route {
|
|||
try {
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
if (req.query.id) {
|
||||
const member = await this.server.client.getRESTGuildMember(this.server.client.config.guildID, req.query.id.toString());
|
||||
const pagerNumber = await this.server.client.db.PagerNumber.findOne({ individualAssignID: member.id });
|
||||
let member = this.server.client.guilds.get(this.server.client.config.guildID).members.get(req.query.id.toString());
|
||||
if (!member) member = await this.server.client.getRESTGuildMember(this.server.client.config.guildID, req.query.id.toString());
|
||||
if (!member) return res.status(404).json({ code: this.constants.codes.NOT_FOUND, message: this.constants.messages.NOT_FOUND });
|
||||
const pagerNumber = await this.server.client.db.PagerNumber.findOne({ individualAssignID: member.id }).lean().exec();
|
||||
let status = false;
|
||||
if (member.roles.includes('446104438969466890') || member.roles.includes('701481967149121627')) status = true;
|
||||
return res.status(200).json({ staff: status, username: member.user.username, discriminator: member.user.discriminator, nick: member.nick, avatarURL: member.user.avatarURL, pager: pagerNumber?.num });
|
||||
|
|
Loading…
Reference in New Issue