@telegram.ts/types 1.23.5 → 1.24.0

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/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.23.5",
3
+ "version": "1.24.0",
4
4
  "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "keywords": [
8
8
  "telegramsjs",
9
9
  "telegram",
10
- "bot",
10
+ "telegramapi",
11
11
  "api",
12
- "types"
12
+ "bot",
13
+ "types",
14
+ "typescript",
15
+ "sempai-07"
13
16
  ],
14
- "homepage": "https://docs-telegramsjs.vercel.app/",
17
+ "homepage": "https://telegramsjs.vercel.app/",
15
18
  "license": "MIT",
16
19
  "bugs": {
17
20
  "url": "https://github.com/telegramsjs/types/issues"
@@ -32,15 +32,13 @@ export declare namespace InlineKeyboardButton {
32
32
  /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account */
33
33
  switch_inline_query: string;
34
34
  }
35
- export interface SwitchInlineCurrentChatButton
36
- extends AbstractInlineKeyboardButton {
35
+ export interface SwitchInlineCurrentChatButton extends AbstractInlineKeyboardButton {
37
36
  /** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.
38
37
 
39
38
  This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
40
39
  switch_inline_query_current_chat: string;
41
40
  }
42
- export interface SwitchInlineChosenChatButton
43
- extends AbstractInlineKeyboardButton {
41
+ export interface SwitchInlineChosenChatButton extends AbstractInlineKeyboardButton {
44
42
  /** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
45
43
  switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
46
44
  }
@@ -1,6 +1,7 @@
1
1
  import type { Chat, User } from "./manageTypes";
2
2
  import type { InlineKeyboardMarkup } from "./markupTypes";
3
3
  import type { PassportData } from "./passportTypes";
4
+ import type { LanguageCode } from "./languageTypes";
4
5
  import type {
5
6
  Checklist,
6
7
  ChecklistTasksAdded,
@@ -364,16 +365,15 @@ export interface SentWebAppMessage {
364
365
  }
365
366
 
366
367
  /** This object describes a message that was deleted or is otherwise inaccessible to the bot. */
367
- export interface InaccessibleMessage
368
- extends Omit<
369
- // TypeScript cannot discriminate union types based on `0` and `number` so
370
- // we work around this by including all other properties here. This mostly
371
- // negates the benefit of having this interface in the first place, but not
372
- // extending Message is not very ergonomic to use. If you have a better idea
373
- // how to model this, please let us know!
374
- Message,
375
- "chat" | "message_id" | "date"
376
- > {
368
+ export interface InaccessibleMessage extends Omit<
369
+ // TypeScript cannot discriminate union types based on `0` and `number` so
370
+ // we work around this by including all other properties here. This mostly
371
+ // negates the benefit of having this interface in the first place, but not
372
+ // extending Message is not very ergonomic to use. If you have a better idea
373
+ // how to model this, please let us know!
374
+ Message,
375
+ "chat" | "message_id" | "date"
376
+ > {
377
377
  /** Chat the message belonged to */
378
378
  chat: Chat;
379
379
  /** Unique message identifier inside the chat */
@@ -530,7 +530,7 @@ export declare namespace MessageEntity {
530
530
  export interface PreMessageEntity extends AbstractMessageEntity {
531
531
  type: "pre";
532
532
  /** For “pre” only, the programming language of the entity text */
533
- language?: string;
533
+ language?: LanguageCode;
534
534
  }
535
535
  export interface TextLinkMessageEntity extends AbstractMessageEntity {
536
536
  type: "text_link";