mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 12:59:14 +00:00
fix: type getMessage()
This commit is contained in:
parent
84f25ecfb1
commit
3d974356d0
@ -227,7 +227,7 @@ export default abstract class EventWrapper<
|
||||
*
|
||||
* @returns The received message
|
||||
*/
|
||||
abstract getMessage(): any;
|
||||
abstract getMessage(): StdIncomingMessage;
|
||||
|
||||
/**
|
||||
* Return the text message received
|
||||
|
@ -136,11 +136,12 @@ export class ConversationService extends BaseService<
|
||||
}
|
||||
|
||||
// Handle attachments (location, ...)
|
||||
if (msgType === 'location') {
|
||||
const coordinates = event.getMessage().coordinates;
|
||||
const msg = event.getMessage();
|
||||
if (msgType === 'location' && 'coordinates' in msg) {
|
||||
const coordinates = msg.coordinates;
|
||||
convo.context.user_location = { lat: 0, lon: 0 };
|
||||
convo.context.user_location.lat = parseFloat(coordinates.lat);
|
||||
convo.context.user_location.lon = parseFloat(coordinates.lon);
|
||||
convo.context.user_location.lat = parseFloat(coordinates.lat.toString());
|
||||
convo.context.user_location.lon = parseFloat(coordinates.lon.toString());
|
||||
} else if (msgType === 'attachments') {
|
||||
// @TODO : deprecated in favor of geolocation msgType
|
||||
const attachments = event.getAttachments();
|
||||
|
Loading…
Reference in New Issue
Block a user