mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
Merge pull request #1044 from Richards0nd/newPhoneNumberContent
Adiciona o número de telefone do remetente nas mensagens recebidas do WhatsApp antes do nome do contato (GRUPOS)
This commit is contained in:
commit
084be1cee2
@ -1970,11 +1970,16 @@ export class ChatwootService {
|
|||||||
|
|
||||||
if (body.key.remoteJid.includes('@g.us')) {
|
if (body.key.remoteJid.includes('@g.us')) {
|
||||||
const participantName = body.pushName;
|
const participantName = body.pushName;
|
||||||
|
const rawPhoneNumber = body.key.remoteJid.split('@')[0];
|
||||||
|
const formattedPhoneNumber = `+${rawPhoneNumber.slice(0, 2)} (${rawPhoneNumber.slice(
|
||||||
|
2,
|
||||||
|
4,
|
||||||
|
)}) ${rawPhoneNumber.slice(4, 8)}-${rawPhoneNumber.slice(8)}`;
|
||||||
|
|
||||||
let content: string;
|
let content: string;
|
||||||
|
|
||||||
if (!body.key.fromMe) {
|
if (!body.key.fromMe) {
|
||||||
content = `**${participantName}:**\n\n${bodyMessage}`;
|
content = `**${formattedPhoneNumber} - ${participantName}:**\n\n${bodyMessage}`;
|
||||||
} else {
|
} else {
|
||||||
content = `${bodyMessage}`;
|
content = `${bodyMessage}`;
|
||||||
}
|
}
|
||||||
@ -2099,11 +2104,16 @@ export class ChatwootService {
|
|||||||
|
|
||||||
if (body.key.remoteJid.includes('@g.us')) {
|
if (body.key.remoteJid.includes('@g.us')) {
|
||||||
const participantName = body.pushName;
|
const participantName = body.pushName;
|
||||||
|
const rawPhoneNumber = body.key.remoteJid.split('@')[0];
|
||||||
|
const formattedPhoneNumber = `+${rawPhoneNumber.slice(0, 2)} (${rawPhoneNumber.slice(
|
||||||
|
2,
|
||||||
|
4,
|
||||||
|
)}) ${rawPhoneNumber.slice(4, 8)}-${rawPhoneNumber.slice(8)}`;
|
||||||
|
|
||||||
let content: string;
|
let content: string;
|
||||||
|
|
||||||
if (!body.key.fromMe) {
|
if (!body.key.fromMe) {
|
||||||
content = `**${participantName}**\n\n${bodyMessage}`;
|
content = `**${formattedPhoneNumber} - ${participantName}:**\n\n${bodyMessage}`;
|
||||||
} else {
|
} else {
|
||||||
content = `${bodyMessage}`;
|
content = `${bodyMessage}`;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user