Merge pull request #373 from leandrosroc/develop

Join in Group by Invite Code
This commit is contained in:
Davidson Gomes
2024-01-21 18:14:40 -03:00
committed by GitHub
6 changed files with 50 additions and 1 deletions

View File

@@ -89,6 +89,7 @@ import {
WhatsAppNumberDto,
} from '../dto/chat.dto';
import {
AcceptGroupInvite,
CreateGroupDto,
GetParticipant,
GroupDescriptionDto,
@@ -3744,6 +3745,16 @@ export class WAStartupService {
}
}
public async acceptInviteCode(id: AcceptGroupInvite) {
this.logger.verbose('Joining the group by invitation code: ' + id.inviteCode);
try {
const groupJid = await this.client.groupAcceptInvite(id.inviteCode);
return { accepted: true, groupJid: groupJid };
} catch (error) {
throw new NotFoundException('Accept invite error', error.toString());
}
}
public async revokeInviteCode(id: GroupJid) {
this.logger.verbose('Revoking invite code for group: ' + id.groupJid);
try {