mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-01-09 05:12:28 -06:00
Join in Group by Invite Code
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user