@ebowwa/channel-telegram 1.17.1 → 1.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -286,3 +286,108 @@ export interface ConversationMessage {
286
286
  role: 'user' | 'assistant';
287
287
  content: string;
288
288
  }
289
+
290
+ // ============================================================
291
+ // Location Types (Live Location Support)
292
+ // ============================================================
293
+
294
+ /**
295
+ * Extended location interface that includes all Telegram Bot API properties.
296
+ * The @types/node-telegram-bot-api only includes latitude/longitude.
297
+ * @see https://core.telegram.org/bots/api#location
298
+ */
299
+ export interface TelegramLocation {
300
+ /** Longitude as defined by sender */
301
+ longitude: number;
302
+ /** Latitude as defined by sender */
303
+ latitude: number;
304
+ /** Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */
305
+ horizontal_accuracy?: number;
306
+ /** Optional. Time relative to the message sending date, during which the location can be updated, in seconds */
307
+ live_period?: number;
308
+ /** Optional. The direction in which the user is moving, in degrees; 1-360 */
309
+ heading?: number;
310
+ /** Optional. The maximum distance for proximity alerts about approaching another chat member, in meters */
311
+ proximity_alert_radius?: number;
312
+ }
313
+
314
+ /**
315
+ * Represents a venue (location + name/address).
316
+ * @see https://core.telegram.org/bots/api#venue
317
+ */
318
+ export interface TelegramVenue {
319
+ /** The location of the venue */
320
+ location: TelegramLocation;
321
+ /** Name of the venue */
322
+ title: string;
323
+ /** Address of the venue */
324
+ address: string;
325
+ /** Optional. Foursquare identifier of the venue */
326
+ foursquare_id?: string;
327
+ /** Optional. Foursquare type of the venue */
328
+ foursquare_type?: string;
329
+ /** Optional. Google Places identifier of the venue */
330
+ google_place_id?: string;
331
+ /** Optional. Google Places type of the venue */
332
+ google_place_type?: string;
333
+ }
334
+
335
+ /**
336
+ * Live location state for tracking active live locations.
337
+ */
338
+ export interface LiveLocationState {
339
+ /** Chat ID where the live location was shared */
340
+ chatId: number;
341
+ /** Message ID of the location message */
342
+ messageId: number;
343
+ /** User ID who shared the location */
344
+ userId: number;
345
+ /** Current location data */
346
+ location: TelegramLocation;
347
+ /** When the live location was first received */
348
+ startedAt: Date;
349
+ /** When the live location expires (calculated from live_period) */
350
+ expiresAt?: Date;
351
+ /** Number of updates received */
352
+ updateCount: number;
353
+ }
354
+
355
+ /**
356
+ * Options for sending a location.
357
+ */
358
+ export interface SendLocationOptions {
359
+ /** Unique identifier for the target message thread (topic) of the forum */
360
+ message_thread_id?: number;
361
+ /** Period in seconds for which the location will be updated (see Live Locations) */
362
+ live_period?: number;
363
+ /** Latitude of the location */
364
+ latitude: number;
365
+ /** Longitude of the location */
366
+ longitude: number;
367
+ /** The radius of uncertainty for the location, measured in meters; 0-1500 */
368
+ horizontal_accuracy?: number;
369
+ /** Direction in which the location moves, in degrees; 1-360 */
370
+ heading?: number;
371
+ /** Maximum distance for proximity alerts, in meters; 1-100000 */
372
+ proximity_alert_radius?: number;
373
+ /** Sends the message silently */
374
+ disable_notification?: boolean;
375
+ /** Protects the contents of the sent message from forwarding and saving */
376
+ protect_content?: boolean;
377
+ }
378
+
379
+ /**
380
+ * Options for editing a live location.
381
+ */
382
+ export interface EditLiveLocationOptions {
383
+ /** Latitude of new location */
384
+ latitude: number;
385
+ /** Longitude of new location */
386
+ longitude: number;
387
+ /** The radius of uncertainty for the location, measured in meters; 0-1500 */
388
+ horizontal_accuracy?: number;
389
+ /** Direction in which the location moves, in degrees; 1-360 */
390
+ heading?: number;
391
+ /** Maximum distance for proximity alerts, in meters; 1-100000 */
392
+ proximity_alert_radius?: number;
393
+ }