UNPKG

tgsnake

Version:

Telegram MTProto framework for nodejs.

66 lines (65 loc) 2.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Venue = exports.Location = void 0; const TL_js_1 = require("../../TL.js"); const platform_node_js_1 = require("../../../platform.node.js"); class Location extends TL_js_1.TLObject { _accessHash; longitude; latitude; horizontalAccuracy; constructor({ accessHash, longitude, latitude, horizontalAccuracy, }, client) { super(client); this._accessHash = accessHash; this.longitude = longitude; this.latitude = latitude; this.horizontalAccuracy = horizontalAccuracy; } static parse(client, location) { if (location instanceof platform_node_js_1.Raw.GeoPointEmpty) { location; return new Location({ accessHash: BigInt(0), longitude: 0, latitude: 0, horizontalAccuracy: 0, }, client); } location; return new Location({ accessHash: location.accessHash, longitude: location.long, latitude: location.lat, horizontalAccuracy: location.accuracyRadius ?? 0, }, client); } } exports.Location = Location; class Venue extends TL_js_1.TLObject { location; title; address; foursquareId; foursquareType; provider; constructor({ location, title, address, foursquareId, foursquareType, provider, }, client) { super(client); this.location = location; this.title = title; this.address = address; this.foursquareId = foursquareId; this.foursquareType = foursquareType; this.provider = provider; } static parse(client, venue) { return new Venue({ location: Location.parse(client, venue.geo), title: venue.title, address: venue.address, foursquareId: venue.venueId, foursquareType: venue.venueType, provider: venue.provider, }, client); } } exports.Venue = Venue;