You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Archive users by setting the roles.archived field to true.
36
+
* This function commits the write in batches to avoid reaching the maximum number of writes per batch.
37
+
* @param {Array} usersData - An array of user objects with the following properties: id, first_name, last_name
38
+
* @returns {Promise} - A promise that resolves with a summary object containing the number of users updated and failed, and an array of updated and failed user details.
* Fetches users who are not in the Discord server.
1093
+
* @returns {Promise<FirebaseFirestore.QuerySnapshot>} - A promise that resolves to a Firestore QuerySnapshot containing the users matching the criteria.
1094
+
* @throws {Error} - Throws an error if the database query fails.
1095
+
*/
1096
+
constfetchUsersNotInDiscordServer=async()=>{
1097
+
try{
1098
+
constusersNotInDiscordServer=awaituserModel
1099
+
.where("roles.archived","==",true)
1100
+
.where("roles.in_discord","==",false)
1101
+
.get();
1102
+
returnusersNotInDiscordServer;
1103
+
}catch(error){
1104
+
logger.error(`Error in getting users who are not in discord server: ${error}`);
0 commit comments