last interval fix
parent
5ec6f20f9e
commit
833066e2fc
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable no-continue */
|
/* eslint-disable no-continue */
|
||||||
/* eslint-disable no-await-in-loop */
|
/* eslint-disable no-await-in-loop */
|
||||||
import { Member, TextableChannel } from 'eris';
|
import { Member, PrivateChannel, TextableChannel } from 'eris';
|
||||||
import { Client } from '../class';
|
import { Client } from '../class';
|
||||||
|
|
||||||
let interval: NodeJS.Timeout;
|
let interval: NodeJS.Timeout;
|
||||||
|
@ -155,6 +155,8 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
});
|
});
|
||||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||||
pager = await newNumber.save();
|
pager = await newNumber.save();
|
||||||
|
|
||||||
|
const channel: PrivateChannel = await client.getDMChannel(member.id);
|
||||||
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||||
await client.util.authClient.createUser({
|
await client.util.authClient.createUser({
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
|
@ -172,12 +174,10 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||||
});
|
});
|
||||||
client.getDMChannel(member.id).then((chan) => {
|
channel.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
||||||
chan.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
|
||||||
chan.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channel.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
||||||
logNewPager(client, randomPagerNumber, member);
|
logNewPager(client, randomPagerNumber, member);
|
||||||
} else if (!pager && member.roles.includes('701454855952138300')) {
|
} else if (!pager && member.roles.includes('701454855952138300')) {
|
||||||
// Supervisors
|
// Supervisors
|
||||||
|
@ -200,6 +200,8 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
});
|
});
|
||||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||||
pager = await newNumber.save();
|
pager = await newNumber.save();
|
||||||
|
|
||||||
|
const channel: PrivateChannel = await client.getDMChannel(member.id);
|
||||||
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||||
await client.util.authClient.createUser({
|
await client.util.authClient.createUser({
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
|
@ -217,12 +219,10 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||||
});
|
});
|
||||||
client.getDMChannel(member.id).then((chan) => {
|
channel.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
||||||
chan.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
|
||||||
chan.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channel.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
||||||
logNewPager(client, randomPagerNumber, member);
|
logNewPager(client, randomPagerNumber, member);
|
||||||
} else if (!pager && member.roles.includes('701454780828221450')) {
|
} else if (!pager && member.roles.includes('701454780828221450')) {
|
||||||
// Technicians
|
// Technicians
|
||||||
|
@ -246,6 +246,8 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
});
|
});
|
||||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||||
pager = await newNumber.save();
|
pager = await newNumber.save();
|
||||||
|
|
||||||
|
const channel: PrivateChannel = await client.getDMChannel(member.id);
|
||||||
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||||
await client.util.authClient.createUser({
|
await client.util.authClient.createUser({
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
|
@ -263,12 +265,10 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||||
});
|
});
|
||||||
client.getDMChannel(member.id).then((chan) => {
|
channel.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
||||||
chan.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
|
||||||
chan.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channel.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
||||||
logNewPager(client, randomPagerNumber, member);
|
logNewPager(client, randomPagerNumber, member);
|
||||||
} else if (!pager && member.roles.includes('455972169449734144')) {
|
} else if (!pager && member.roles.includes('455972169449734144')) {
|
||||||
// Moderators
|
// Moderators
|
||||||
|
@ -292,6 +292,8 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
});
|
});
|
||||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||||
pager = await newNumber.save();
|
pager = await newNumber.save();
|
||||||
|
|
||||||
|
const channel: PrivateChannel = await client.getDMChannel(member.id);
|
||||||
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||||
await client.util.authClient.createUser({
|
await client.util.authClient.createUser({
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
|
@ -309,12 +311,10 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||||
});
|
});
|
||||||
client.getDMChannel(member.id).then((chan) => {
|
channel.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
||||||
chan.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
|
||||||
chan.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channel.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
||||||
logNewPager(client, randomPagerNumber, member);
|
logNewPager(client, randomPagerNumber, member);
|
||||||
} else if (!pager && member.roles.includes('453689940140883988')) {
|
} else if (!pager && member.roles.includes('453689940140883988')) {
|
||||||
// Core Team
|
// Core Team
|
||||||
|
@ -338,6 +338,8 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
});
|
});
|
||||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||||
pager = await newNumber.save();
|
pager = await newNumber.save();
|
||||||
|
|
||||||
|
const channel: PrivateChannel = await client.getDMChannel(member.id);
|
||||||
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||||
await client.util.authClient.createUser({
|
await client.util.authClient.createUser({
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
|
@ -355,12 +357,10 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||||
});
|
});
|
||||||
client.getDMChannel(member.id).then((chan) => {
|
channel.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
||||||
chan.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
|
||||||
chan.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channel.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
||||||
logNewPager(client, randomPagerNumber, member);
|
logNewPager(client, randomPagerNumber, member);
|
||||||
} else if (!pager && member.roles.includes('701481967149121627')) {
|
} else if (!pager && member.roles.includes('701481967149121627')) {
|
||||||
// Associates
|
// Associates
|
||||||
|
@ -384,6 +384,8 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
});
|
});
|
||||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||||
pager = await newNumber.save();
|
pager = await newNumber.save();
|
||||||
|
|
||||||
|
const channel: PrivateChannel = await client.getDMChannel(member.id);
|
||||||
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
if (!(await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||||
await client.util.authClient.createUser({
|
await client.util.authClient.createUser({
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
|
@ -401,12 +403,10 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
||||||
email: acknowledgement.emailAddress,
|
email: acknowledgement.emailAddress,
|
||||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||||
});
|
});
|
||||||
client.getDMChannel(member.id).then((chan) => {
|
channel.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
||||||
chan.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
|
||||||
chan.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n__Reset Password__\n\nPlease click on the link below to change your IAM password.\n${passwordTicket.ticket}`);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channel.createMessage(`__**Pager Number Creation**__\nYour individual pager number has been automatically created. Your number (PN) is ${randomPagerNumber}.`);
|
||||||
logNewPager(client, randomPagerNumber, member);
|
logNewPager(client, randomPagerNumber, member);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue