feat: Route to update group description

This commit is contained in:
Davidson Gomes
2023-06-12 12:05:52 -03:00
parent a28bbce1f9
commit ea9ba27f22
6 changed files with 54 additions and 0 deletions

View File

@@ -101,6 +101,7 @@ import {
GroupUpdateSettingDto,
GroupToggleEphemeralDto,
GroupSubjectDto,
GroupDescriptionDto,
} from '../dto/group.dto';
import { MessageUpQuery } from '../repository/messageUp.repository';
import { useMultiFileAuthStateDb } from '../../utils/use-multi-file-auth-state-db';
@@ -1652,6 +1653,19 @@ export class WAStartupService {
}
}
public async updateGroupDescription(data: GroupDescriptionDto) {
try {
await this.client.groupUpdateDescription(data.groupJid, data.description);
return { update: 'success' };
} catch (error) {
throw new InternalServerErrorException(
'Error updating group description',
error.toString(),
);
}
}
public async findGroup(id: GroupJid, reply: 'inner' | 'out' = 'out') {
try {
return await this.client.groupMetadata(id.groupJid);