fix: crypto.randumUUID is not a function on Manager

This commit is contained in:
Davidson Gomes
2024-08-14 16:01:14 -03:00
parent b3991cf6bb
commit 360f8066a7
3 changed files with 105 additions and 107 deletions

View File

@@ -3423,38 +3423,36 @@ export class BaileysStartupService extends ChannelStartupService {
}
public async fetchAllGroups(getParticipants: GetParticipant) {
try {
const fetch = Object.values(await this?.client?.groupFetchAllParticipating());
let groups = [];
for (const group of fetch) {
const picture = await this.profilePicture(group.id);
const fetch = Object.values(await this?.client?.groupFetchAllParticipating());
const result = {
id: group.id,
subject: group.subject,
subjectOwner: group.subjectOwner,
subjectTime: group.subjectTime,
pictureUrl: picture.profilePictureUrl,
size: group.participants.length,
creation: group.creation,
owner: group.owner,
desc: group.desc,
descId: group.descId,
restrict: group.restrict,
announce: group.announce,
};
let groups = [];
for (const group of fetch) {
const picture = null;
// const picture = await this.profilePicture(group.id);
if (getParticipants.getParticipants == 'true') {
result['participants'] = group.participants;
}
const result = {
id: group.id,
subject: group.subject,
subjectOwner: group.subjectOwner,
subjectTime: group.subjectTime,
pictureUrl: picture?.profilePictureUrl,
size: group.participants.length,
creation: group.creation,
owner: group.owner,
desc: group.desc,
descId: group.descId,
restrict: group.restrict,
announce: group.announce,
};
groups = [...groups, result];
if (getParticipants.getParticipants == 'true') {
result['participants'] = group.participants;
}
return groups;
} catch (error) {
throw new NotFoundException('Error fetching group', error.toString());
groups = [...groups, result];
}
return groups;
}
public async inviteCode(id: GroupJid) {