mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 01:41:24 -06:00
fix: Solved receive location in chatwoot
This commit is contained in:
parent
4c006970a2
commit
89f40d54d9
@ -3,6 +3,7 @@
|
||||
### Fixed
|
||||
|
||||
* Fixed chatwoot line wrap issue
|
||||
* Solved receive location in chatwoot
|
||||
|
||||
# 1.4.3 (2023-07-25 10:51)
|
||||
|
||||
|
@ -13,6 +13,7 @@ import { SendAudioDto } from '../dto/sendMessage.dto';
|
||||
import { SendMediaDto } from '../dto/sendMessage.dto';
|
||||
import { ROOT_DIR } from '../../config/path.config';
|
||||
import { ConfigService, HttpServer } from '../../config/env.config';
|
||||
import { type } from 'os';
|
||||
|
||||
export class ChatwootService {
|
||||
private messageCacheFile: string;
|
||||
@ -1186,6 +1187,10 @@ export class ChatwootService {
|
||||
audioMessage: msg.audioMessage?.caption,
|
||||
contactMessage: msg.contactMessage?.vcard,
|
||||
contactsArrayMessage: msg.contactsArrayMessage,
|
||||
locationMessage:
|
||||
msg.locationMessage?.degreesLatitude +
|
||||
',' +
|
||||
msg.locationMessage?.degreesLongitude,
|
||||
};
|
||||
|
||||
this.logger.verbose('type message: ' + types);
|
||||
@ -1199,6 +1204,20 @@ export class ChatwootService {
|
||||
|
||||
const result = typeKey ? types[typeKey] : undefined;
|
||||
|
||||
if (typeKey === 'locationMessage') {
|
||||
const [latitude, longitude] = result.split(',');
|
||||
|
||||
const formattedLocation = `**Location:**
|
||||
**latitude:** ${latitude}
|
||||
**longitude:** ${longitude}
|
||||
https://www.google.com/maps/search/?api=1&query=${latitude},${longitude}
|
||||
`;
|
||||
|
||||
this.logger.verbose('message content: ' + formattedLocation);
|
||||
|
||||
return formattedLocation;
|
||||
}
|
||||
|
||||
if (typeKey === 'contactMessage') {
|
||||
const vCardData = result.split('\n');
|
||||
const contactInfo = {};
|
||||
|
Loading…
Reference in New Issue
Block a user