add t2 pre-approval
parent
ad089f28ba
commit
6f72ef9668
|
@ -66,8 +66,10 @@ export default class Queue {
|
||||||
await message.delete();
|
await message.delete();
|
||||||
const embed = new RichEmbed();
|
const embed = new RichEmbed();
|
||||||
embed.setTitle('Application Decision');
|
embed.setTitle('Application Decision');
|
||||||
|
embed.setDescription(`This application was processed by __${application.processedBy}__ on behalf of the vendor, department, or service who operates this application. Please contact the vendor for further information about your application if needed.`);
|
||||||
embed.addField('Status', application.decision, true);
|
embed.addField('Status', application.decision, true);
|
||||||
embed.addField('User ID', job.data.userID, true);
|
embed.addField('User ID', job.data.userID, true);
|
||||||
|
embed.addField('Application ID', application.id, true);
|
||||||
embed.addField('Job ID', job.id.toString(), true);
|
embed.addField('Job ID', job.id.toString(), true);
|
||||||
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
|
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
|
||||||
embed.setTimestamp();
|
embed.setTimestamp();
|
||||||
|
|
|
@ -45,13 +45,12 @@ export default class Apply extends Command {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/* this.services.set('cs::t2', {
|
this.services.set('p::cs::t2', {
|
||||||
description: 'Pre-approval for Tier 2.',
|
description: 'Pre-approval for Tier 2.',
|
||||||
type: 'SOFT',
|
type: 'SOFT',
|
||||||
url: 'https://eds.libraryofcode.org/cs/t2pre-get',
|
url: 'https://eds.libraryofcode.org/cs/t2pre',
|
||||||
validation: (member: Member) => !member.roles.includes('546457886440685578'),
|
validation: (member: Member) => member.roles.includes('546457886440685578'),
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async run(message: Message, args: string[]) {
|
public async run(message: Message, args: string[]) {
|
||||||
|
@ -60,7 +59,7 @@ export default class Apply extends Command {
|
||||||
const embed = new RichEmbed();
|
const embed = new RichEmbed();
|
||||||
embed.setTitle('Available Instant Applications');
|
embed.setTitle('Available Instant Applications');
|
||||||
for (const service of this.services) {
|
for (const service of this.services) {
|
||||||
embed.addField(service[0], `__**Description**__\n${service[1].description}\n__**Inquiry Type**__\n${service[1].type}\n\n*Run \`${this.client.config.prefix}apply ${service[0]}\` to apply.*`);
|
embed.addField(service[0], `**Description**: ${service[1].description}\n**Inquiry Type:** ${service[1].type}\n\n*Run \`${this.client.config.prefix}apply ${service[0]}\` to apply.*`);
|
||||||
}
|
}
|
||||||
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
|
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
|
||||||
embed.setTimestamp();
|
embed.setTimestamp();
|
||||||
|
@ -72,7 +71,7 @@ export default class Apply extends Command {
|
||||||
const test = await this.services.get(args[0]).validation(message.member);
|
const test = await this.services.get(args[0]).validation(message.member);
|
||||||
if (!test) return this.error(message.channel, 'A condition exists which prevents you from applying, please try again later.');
|
if (!test) return this.error(message.channel, 'A condition exists which prevents you from applying, please try again later.');
|
||||||
const msg = await this.loading(message.channel, 'Thank you for submitting an application. We are currently processing it, you will be pinged here shortly with the decision.');
|
const msg = await this.loading(message.channel, 'Thank you for submitting an application. We are currently processing it, you will be pinged here shortly with the decision.');
|
||||||
return await this.client.queue.processApplication({ channelID: message.channel.id, guildID: this.mainGuild.id, messageID: msg.id }, service.url, message.author.id, service.func.toString());
|
return await this.client.queue.processApplication({ channelID: message.channel.id, guildID: this.mainGuild.id, messageID: msg.id }, service.url, message.author.id, service.func ? service.func.toString() : undefined);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return this.client.util.handleError(err, message, this);
|
return this.client.util.handleError(err, message, this);
|
||||||
}
|
}
|
||||||
|
@ -88,11 +87,13 @@ export default class Apply extends Command {
|
||||||
return {
|
return {
|
||||||
status: 'SUCCESS',
|
status: 'SUCCESS',
|
||||||
decision: data.decision,
|
decision: data.decision,
|
||||||
|
id: data.id,
|
||||||
|
processedBy: data.processedBy,
|
||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const error = <AxiosError>err;
|
const error = <AxiosError>err;
|
||||||
if (error.response?.status === 404 || error.response.status === 400 || error.response.status === 401) return { status: 'CLIENT_ERROR', decision: 'PRE-DECLINED' };
|
if (error.response?.status === 404 || error.response.status === 400 || error.response.status === 401) return { id: 'N/A', processedBy: 'N/A', status: 'CLIENT_ERROR', decision: 'PRE-DECLINED' };
|
||||||
return { status: 'SERVER_ERROR', decision: 'PRE-DECLINED' };
|
return { id: 'N/A', processedBy: 'N/A', status: 'SERVER_ERROR', decision: 'PRE-DECLINED' };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue