Open brendorsilva opened 8 months ago
estou com o mesmo problema , nao encontrei em lugar algum a soluçao ,
src/services/WbotServices/wbotMessageListener.ts:152:77 - error TS2339: Property 'description' does not exist on type 'Location'.
152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
~~~~~~~~~~~
src/services/WbotServices/wbotMessageListener.ts:152:124 - error TS2339: Property 'description' does not exist on type 'Location'.
152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
~~~~~~~~~~~
src/services/WbotServices/wbotMessageListener.ts:162:35 - error TS2339: Property 'description' does not exist on type 'Location'.
162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
src/services/WbotServices/wbotMessageListener.ts:162:62 - error TS2339: Property 'description' does not exist on type 'Location'.
162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
Found 4 errors.
well, you have to change in this file backend/src/services/WbotServices/wbotMessageListener.ts the following:
const prepareLocation = (msg: WbotMessage): WbotMessage => {
const gmapsUrl = https://maps.google.com/maps?q=${msg.location.latitude}%2C${msg.location.longitude}&z=17
;
msg.body = data:image/png;base64,${msg.body}|${gmapsUrl}
;
msg.body += |${msg.location.options ? msg.location.options :
${msg.location.latitude}, ${msg.location.longitude} }
;
return msg;
};
const verifyMessage = async ( msg: WbotMessage, ticket: Ticket, contact: Contact ) => { if (msg.type === "location") msg = prepareLocation(msg);
const quotedMsg = await verifyQuotedMessage(msg); const messageData = { id: msg.id.id, ticketId: ticket.id, contactId: msg.fromMe ? undefined : contact.id, body: msg.body, fromMe: msg.fromMe, mediaType: msg.type, read: msg.fromMe, quotedMsgId: quotedMsg?.id };
await ticket.update({ lastMessage: msg.type === "location" ? msg.location.options || "Localization" : msg.body });
await CreateMessageService({ messageData }); };
Thanks @egorky for your solution
Mano boa noite estou com esses erros abaixo
npm run build
backend@1.0.0 build tsc
src/services/WbotServices/wbotMessageListener.ts:152:77 - error TS2339: Property 'description' does not exist on type 'Location'.
152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
src/services/WbotServices/wbotMessageListener.ts:152:124 - error TS2339: Property 'description' does not exist on type 'Location'.
152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\\n')[0] : "Localization" : msg.body });
src/services/WbotServices/wbotMessageListener.ts:162:35 - error TS2339: Property 'description' does not exist on type 'Location'.
162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
src/services/WbotServices/wbotMessageListener.ts:162:62 - error TS2339: Property 'description' does not exist on type 'Location'.
162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
Found 4 errors.
Poderia me passar uma possivel solução desde já agradecido !
Mano boa noite estou com esses erros abaixo
npm run build
backend@1.0.0 build tsc
src/services/WbotServices/wbotMessageListener.ts:152:77 - error TS2339: Property 'description' does not exist on type 'Location'.
152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
~~~src/services/WbotServices/wbotMessageListener.ts:152:124 - error TS2339: Property 'description' does not exist on type 'Location'.
152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
~~~src/services/WbotServices/wbotMessageListener.ts:162:35 - error TS2339: Property 'description' does not exist on type 'Location'.
162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
~~~src/services/WbotServices/wbotMessageListener.ts:162:62 - error TS2339: Property 'description' does not exist on type 'Location'.
162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
~~~Found 4 errors.
Poderia me passar uma possivel solução desde já agradecido !
Hi, here's the correction in my fork. Replace the link file to your respective target (backend/src/services/WbotServices/wbotMessageListener.ts)
Credits @egorky
That's solved but my chats getting delayed now. Any idea?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
When running
npm run build
I am receiving the following error:deploy@admistrador-Standard-PC-i440FX-PIIX-1996:~/whaticket/backend$ npm run build
src/services/WbotServices/wbotMessageListener.ts:152:77 - error TS2339: Property 'description' does not exist on type 'Location'.
152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
src/services/WbotServices/wbotMessageListener.ts:162:35 - error TS2339: Property 'description' does not exist on type 'Location'.
162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
Found 4 errors.