mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 09:51:24 -06:00
fix: Promote All Participants in Create Group
Promote All Participants in Create Group
This commit is contained in:
commit
036a8edca0
@ -667,6 +667,7 @@ export const createGroupSchema: JSONSchema7 = {
|
|||||||
subject: { type: 'string' },
|
subject: { type: 'string' },
|
||||||
description: { type: 'string' },
|
description: { type: 'string' },
|
||||||
profilePicture: { type: 'string' },
|
profilePicture: { type: 'string' },
|
||||||
|
promoteParticipants: { type: 'boolean', enum: [true, false] },
|
||||||
participants: {
|
participants: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
minItems: 1,
|
minItems: 1,
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
export class CreateGroupDto {
|
export class CreateGroupDto {
|
||||||
subject: string;
|
subject: string;
|
||||||
description?: string;
|
|
||||||
participants: string[];
|
participants: string[];
|
||||||
|
description?: string;
|
||||||
|
promoteParticipants?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GroupPictureDto {
|
export class GroupPictureDto {
|
||||||
|
@ -2775,10 +2775,19 @@ export class WAStartupService {
|
|||||||
await this.client.groupUpdateDescription(id, create.description);
|
await this.client.groupUpdateDescription(id, create.description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (create?.promoteParticipants) {
|
||||||
|
this.logger.verbose('Prometing group participants: ' + create.description);
|
||||||
|
await this.updateGParticipant({
|
||||||
|
groupJid: id,
|
||||||
|
action: "promote",
|
||||||
|
participants: participants
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const group = await this.client.groupMetadata(id);
|
const group = await this.client.groupMetadata(id);
|
||||||
this.logger.verbose('Getting group metadata');
|
this.logger.verbose('Getting group metadata');
|
||||||
|
|
||||||
return { groupMetadata: group };
|
return group;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(error);
|
this.logger.error(error);
|
||||||
throw new InternalServerErrorException('Error creating group', error.toString());
|
throw new InternalServerErrorException('Error creating group', error.toString());
|
||||||
|
Loading…
Reference in New Issue
Block a user