Skip to content

Commit ef4be6a

Browse files
committed
Start
1 parent be7bb2e commit ef4be6a

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/validate/validate.schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ export const createGroupSchema: JSONSchema7 = {
669669
subject: { type: 'string' },
670670
description: { type: 'string' },
671671
profilePicture: { type: 'string' },
672+
promoteParticipants: { type: 'boolean', enum: [true, false] },
672673
participants: {
673674
type: 'array',
674675
minItems: 1,

src/whatsapp/dto/group.dto.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export class CreateGroupDto {
22
subject: string;
3-
description?: string;
43
participants: string[];
4+
description?: string;
5+
promoteParticipants?: boolean;
56
}
67

78
export class GroupPictureDto {

src/whatsapp/services/whatsapp.service.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2785,11 +2785,20 @@ export class WAStartupService {
27852785
this.logger.verbose('Updating group description: ' + create.description);
27862786
await this.client.groupUpdateDescription(id, create.description);
27872787
}
2788+
2789+
if (create?.promoteParticipants) {
2790+
this.logger.verbose('Prometing group participants: ' + create.description);
2791+
await this.updateGParticipant({
2792+
groupJid: id,
2793+
action: "promote",
2794+
participants: participants
2795+
});
2796+
}
27882797

27892798
const group = await this.client.groupMetadata(id);
27902799
this.logger.verbose('Getting group metadata');
27912800

2792-
return { groupMetadata: group };
2801+
return group;
27932802
} catch (error) {
27942803
this.logger.error(error);
27952804
throw new InternalServerErrorException('Error creating group', error.toString());

0 commit comments

Comments
 (0)