attempt x2 fix
parent
8731dfcf61
commit
97b22ef72b
|
@ -155,27 +155,30 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
|||
});
|
||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||
pager = await newNumber.save();
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
boardOfDirectors: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
if ((await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
boardOfDirectors: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
}
|
||||
|
||||
logNewPager(client, randomPagerNumber, member);
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
} else if (!pager && member.roles.includes('701454855952138300')) {
|
||||
// Supervisors
|
||||
let randomPagerNumber: string;
|
||||
|
@ -197,27 +200,30 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
|||
});
|
||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||
pager = await newNumber.save();
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
supervisor: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
if ((await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
supervisor: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
}
|
||||
|
||||
logNewPager(client, randomPagerNumber, member);
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
} else if (!pager && member.roles.includes('701454780828221450')) {
|
||||
// Technicians
|
||||
let randomPagerNumber: string;
|
||||
|
@ -240,27 +246,30 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
|||
});
|
||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||
pager = await newNumber.save();
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
technician: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
if ((await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
technician: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
}
|
||||
|
||||
logNewPager(client, randomPagerNumber, member);
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
} else if (!pager && member.roles.includes('455972169449734144')) {
|
||||
// Moderators
|
||||
let randomPagerNumber: string;
|
||||
|
@ -283,27 +292,30 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
|||
});
|
||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||
pager = await newNumber.save();
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
moderator: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
if ((await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
moderator: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
}
|
||||
|
||||
logNewPager(client, randomPagerNumber, member);
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
} else if (!pager && member.roles.includes('453689940140883988')) {
|
||||
// Core Team
|
||||
let randomPagerNumber: string;
|
||||
|
@ -326,27 +338,30 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
|||
});
|
||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||
pager = await newNumber.save();
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
coreTeam: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
if ((await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
coreTeam: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
}
|
||||
|
||||
logNewPager(client, randomPagerNumber, member);
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
} else if (!pager && member.roles.includes('701481967149121627')) {
|
||||
// Associates
|
||||
let randomPagerNumber: string;
|
||||
|
@ -369,27 +384,30 @@ export default async function departmentPager(client: Client): Promise<NodeJS.Ti
|
|||
});
|
||||
if (await client.db.PagerNumber.findOne({ num: randomPagerNumber })) continue;
|
||||
pager = await newNumber.save();
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
associate: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
if ((await client.util.authClient.getUsersByEmail(acknowledgement.emailAddress)).length) {
|
||||
await client.util.authClient.createUser({
|
||||
email: acknowledgement.emailAddress,
|
||||
name: member.username,
|
||||
user_id: member.id,
|
||||
connection: 'Staff-Database',
|
||||
email_verified: true,
|
||||
app_metadata: {
|
||||
associate: true,
|
||||
},
|
||||
picture: member.avatarURL,
|
||||
password: client.config.defaultAccountPassword,
|
||||
});
|
||||
const passwordTicket = await client.util.authClient.createPasswordChangeTicket({
|
||||
email: acknowledgement.emailAddress,
|
||||
connection_id: 'con_T3ELEx2reigKMSlP',
|
||||
});
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
}
|
||||
|
||||
logNewPager(client, randomPagerNumber, member);
|
||||
client.getDMChannel(member.id).then((chan) => {
|
||||
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}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue