test: status/stories

This commit is contained in:
Davidson Gomes 2023-07-18 20:23:18 -03:00
parent 41fa700fb3
commit 3cf0ced62e
5 changed files with 19 additions and 7 deletions

View File

@ -27,6 +27,7 @@
* Fixed require fileName for document only in base64 for send media message
* Bug fix when sending mobile message change contact name to number in chatwoot
* Bug fix when connecting whatsapp does not send confirmation message
* Fixed quoted message with id or message directly
### Integrations

View File

@ -82,8 +82,8 @@ const quotedOptionsSchema: JSONSchema7 = {
remoteJid: { type: 'string' },
fromMe: { type: 'boolean', enum: [true, false] },
},
required: ['id', 'remoteJid', 'fromMe'],
...isNotEmpty('id', 'remoteJid'),
required: ['id'],
...isNotEmpty('id'),
},
message: { type: 'object' },
},

View File

@ -11,7 +11,6 @@ import {
import { InstanceDto } from '../dto/instance.dto';
import { cache, waMonitor } from '../whatsapp.module';
import { Database, Redis, configService } from '../../config/env.config';
import { RedisCache } from '../../db/redis.client';
async function getInstance(instanceName: string) {
const db = configService.get<Database>('DATABASE');

View File

@ -936,7 +936,7 @@ export class ChatwootService {
const command = messageReceived.replace('/', '');
if (command === 'init') {
if (command === 'init' || command === 'iniciar') {
this.logger.verbose('command init found');
const state = waInstance?.connectionStatus?.state;
@ -977,7 +977,7 @@ export class ChatwootService {
}
}
if (command === 'disconnect') {
if (command === 'disconnect' || command === 'desconectar') {
this.logger.verbose('command disconnect found');
const msgLogout = `🚨 Disconnecting Whatsapp from inbox *${body.inbox.name}*: `;

View File

@ -1480,7 +1480,17 @@ export class WAStartupService {
let quoted: WAMessage;
if (options?.quoted) {
quoted = options?.quoted;
const m = options?.quoted;
const msg = m?.message
? m
: ((await this.getMessage(m.key, true)) as proto.IWebMessageInfo);
if (!msg) {
throw 'Message not found';
}
quoted = msg;
this.logger.verbose('Quoted message');
}
@ -1776,8 +1786,10 @@ export class WAStartupService {
public async statusMessage(data: SendStatusDto) {
this.logger.verbose('Sending status message');
const status = await this.formatStatusMessage(data.statusMessage);
return await this.sendMessageWithTyping('status@broadcast', {
status: await this.formatStatusMessage(data.statusMessage),
status,
});
}