@mtcute/core 0.27.9 → 0.28.1

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.
Files changed (87) hide show
  1. package/client.cjs +12 -0
  2. package/client.js +12 -0
  3. package/highlevel/base.cjs +2 -0
  4. package/highlevel/base.js +2 -0
  5. package/highlevel/client.d.cts +27 -2
  6. package/highlevel/client.d.ts +27 -2
  7. package/highlevel/methods/chats/batched-queries.cjs +2 -4
  8. package/highlevel/methods/chats/batched-queries.d.cts +1 -1
  9. package/highlevel/methods/chats/batched-queries.d.ts +1 -1
  10. package/highlevel/methods/chats/batched-queries.js +2 -4
  11. package/highlevel/methods/chats/get-chats.cjs +27 -0
  12. package/highlevel/methods/chats/get-chats.d.cts +9 -0
  13. package/highlevel/methods/chats/get-chats.d.ts +9 -0
  14. package/highlevel/methods/chats/get-chats.js +22 -0
  15. package/highlevel/methods/chats/get-chats.test.d.cts +1 -0
  16. package/highlevel/methods/chats/get-chats.test.d.ts +1 -0
  17. package/highlevel/methods/chats/get-creator-after-leave.cjs +18 -0
  18. package/highlevel/methods/chats/get-creator-after-leave.d.cts +9 -0
  19. package/highlevel/methods/chats/get-creator-after-leave.d.ts +9 -0
  20. package/highlevel/methods/chats/get-creator-after-leave.js +13 -0
  21. package/highlevel/methods/chats/get-peers.cjs +16 -0
  22. package/highlevel/methods/chats/get-peers.d.cts +9 -0
  23. package/highlevel/methods/chats/get-peers.d.ts +9 -0
  24. package/highlevel/methods/chats/get-peers.js +11 -0
  25. package/highlevel/methods/chats/get-peers.test.d.cts +1 -0
  26. package/highlevel/methods/chats/get-peers.test.d.ts +1 -0
  27. package/highlevel/methods/contacts/set-contact-note.cjs +2 -0
  28. package/highlevel/methods/contacts/set-contact-note.js +2 -0
  29. package/highlevel/methods/files/download-iterable.cjs +17 -6
  30. package/highlevel/methods/files/download-iterable.js +17 -6
  31. package/highlevel/methods/gifts/get-resale-star-gifts.cjs +2 -1
  32. package/highlevel/methods/gifts/get-resale-star-gifts.d.cts +2 -0
  33. package/highlevel/methods/gifts/get-resale-star-gifts.d.ts +2 -0
  34. package/highlevel/methods/gifts/get-resale-star-gifts.js +2 -1
  35. package/highlevel/methods/users/get-users.d.cts +1 -2
  36. package/highlevel/methods/users/get-users.d.ts +1 -2
  37. package/highlevel/methods.d.cts +3 -0
  38. package/highlevel/methods.d.ts +3 -0
  39. package/highlevel/types/bots/keyboards/factories.cjs +26 -18
  40. package/highlevel/types/bots/keyboards/factories.d.cts +34 -10
  41. package/highlevel/types/bots/keyboards/factories.d.ts +34 -10
  42. package/highlevel/types/bots/keyboards/factories.js +26 -18
  43. package/highlevel/types/messages/message-action.cjs +18 -0
  44. package/highlevel/types/messages/message-action.d.cts +20 -1
  45. package/highlevel/types/messages/message-action.d.ts +20 -1
  46. package/highlevel/types/messages/message-action.js +18 -0
  47. package/highlevel/types/peers/chat.cjs +1 -1
  48. package/highlevel/types/peers/chat.js +1 -1
  49. package/highlevel/types/peers/peer.cjs +13 -3
  50. package/highlevel/types/peers/peer.d.cts +4 -0
  51. package/highlevel/types/peers/peer.d.ts +4 -0
  52. package/highlevel/types/peers/peer.js +13 -3
  53. package/highlevel/types/peers/user.cjs +3 -0
  54. package/highlevel/types/peers/user.d.cts +1 -0
  55. package/highlevel/types/peers/user.d.ts +1 -0
  56. package/highlevel/types/peers/user.js +3 -0
  57. package/highlevel/types/premium/saved-star-gift.cjs +4 -0
  58. package/highlevel/types/premium/saved-star-gift.d.cts +2 -0
  59. package/highlevel/types/premium/saved-star-gift.d.ts +2 -0
  60. package/highlevel/types/premium/saved-star-gift.js +4 -0
  61. package/highlevel/types/premium/star-gift-unique.cjs +43 -4
  62. package/highlevel/types/premium/star-gift-unique.d.cts +18 -4
  63. package/highlevel/types/premium/star-gift-unique.d.ts +18 -4
  64. package/highlevel/types/premium/star-gift-unique.js +43 -4
  65. package/highlevel/updates/manager.cjs +2 -0
  66. package/highlevel/updates/manager.js +2 -0
  67. package/methods.cjs +6 -0
  68. package/methods.js +6 -0
  69. package/network/mtproto-session.cjs +2 -0
  70. package/network/mtproto-session.js +2 -0
  71. package/network/network-manager.cjs +1 -1
  72. package/network/network-manager.js +1 -1
  73. package/network/session-connection.cjs +2 -0
  74. package/network/session-connection.js +2 -0
  75. package/network/transports/intermediate.cjs +2 -0
  76. package/network/transports/intermediate.js +2 -0
  77. package/package.json +3 -3
  78. package/storage/storage.cjs +2 -0
  79. package/storage/storage.js +2 -0
  80. package/utils/binary/compat.cjs +106 -4
  81. package/utils/binary/compat.d.cts +3 -0
  82. package/utils/binary/compat.d.ts +3 -0
  83. package/utils/binary/compat.js +107 -5
  84. package/utils/index.d.cts +2 -0
  85. package/utils/index.d.ts +2 -0
  86. package/utils.cjs +11 -0
  87. package/utils.js +6 -1
@@ -50,11 +50,14 @@ export { getChatMember } from './methods/chats/get-chat-member.js';
50
50
  export { getChatMembers } from './methods/chats/get-chat-members.js';
51
51
  export { getChatPreview } from './methods/chats/get-chat-preview.js';
52
52
  export { getChat } from './methods/chats/get-chat.js';
53
+ export { getChats } from './methods/chats/get-chats.js';
54
+ export { getCreatorAfterLeave } from './methods/chats/get-creator-after-leave.js';
53
55
  export { getFullChat } from './methods/chats/get-full-chat.js';
54
56
  export { getFullUser } from './methods/chats/get-full-user.js';
55
57
  export { getMessageAuthor } from './methods/chats/get-message-author.js';
56
58
  export { getNearbyChats } from './methods/chats/get-nearby-chats.js';
57
59
  export { getPeer } from './methods/chats/get-peer.js';
60
+ export { getPeers } from './methods/chats/get-peers.js';
58
61
  export { getSimilarChannels } from './methods/chats/get-similar-channels.js';
59
62
  export { getUser } from './methods/chats/get-user.js';
60
63
  export { iterChatEventLog } from './methods/chats/iter-chat-event-log.js';
@@ -50,11 +50,14 @@ export { getChatMember } from './methods/chats/get-chat-member.js';
50
50
  export { getChatMembers } from './methods/chats/get-chat-members.js';
51
51
  export { getChatPreview } from './methods/chats/get-chat-preview.js';
52
52
  export { getChat } from './methods/chats/get-chat.js';
53
+ export { getChats } from './methods/chats/get-chats.js';
54
+ export { getCreatorAfterLeave } from './methods/chats/get-creator-after-leave.js';
53
55
  export { getFullChat } from './methods/chats/get-full-chat.js';
54
56
  export { getFullUser } from './methods/chats/get-full-user.js';
55
57
  export { getMessageAuthor } from './methods/chats/get-message-author.js';
56
58
  export { getNearbyChats } from './methods/chats/get-nearby-chats.js';
57
59
  export { getPeer } from './methods/chats/get-peer.js';
60
+ export { getPeers } from './methods/chats/get-peers.js';
58
61
  export { getSimilarChannels } from './methods/chats/get-similar-channels.js';
59
62
  export { getUser } from './methods/chats/get-user.js';
60
63
  export { iterChatEventLog } from './methods/chats/iter-chat-event-log.js';
@@ -61,34 +61,37 @@ function requestPoll(text2, quiz) {
61
61
  quiz
62
62
  };
63
63
  }
64
- function url(text2, url2) {
64
+ function url(text2, url2, options) {
65
65
  return {
66
66
  _: "keyboardButtonUrl",
67
67
  text: text2,
68
- url: url2
68
+ url: url2,
69
+ style: options?.style
69
70
  };
70
71
  }
71
- function callback(text2, data, requiresPassword) {
72
+ function callback(text2, data, options) {
72
73
  return {
73
74
  _: "keyboardButtonCallback",
74
75
  text: text2,
75
- requiresPassword,
76
+ requiresPassword: options?.requiresPassword,
77
+ style: options?.style,
76
78
  data: typeof data === "string" ? utils.utf8.encoder.encode(data) : data
77
79
  };
78
80
  }
79
- function switchInline(text2, query = "", currentChat) {
81
+ function switchInline(text2, options) {
80
82
  return {
81
83
  _: "keyboardButtonSwitchInline",
82
- samePeer: currentChat,
84
+ samePeer: options?.currentChat,
85
+ style: options?.style,
83
86
  text: text2,
84
- query
87
+ query: options?.query ?? ""
85
88
  };
86
89
  }
87
- function game(text2) {
88
- return { _: "keyboardButtonGame", text: text2 };
90
+ function game(text2, options) {
91
+ return { _: "keyboardButtonGame", text: text2, style: options?.style };
89
92
  }
90
- function pay(text2) {
91
- return { _: "keyboardButtonBuy", text: text2 };
93
+ function pay(text2, options) {
94
+ return { _: "keyboardButtonBuy", text: text2, style: options?.style };
92
95
  }
93
96
  function urlAuth(text2, url2, params = {}) {
94
97
  return {
@@ -99,21 +102,24 @@ function urlAuth(text2, url2, params = {}) {
99
102
  _: "inputUserSelf"
100
103
  },
101
104
  fwdText: params.fwdText,
102
- requestWriteAccess: params.requestWriteAccess
105
+ requestWriteAccess: params.requestWriteAccess,
106
+ style: params.style
103
107
  };
104
108
  }
105
- function webView(text2, url2) {
109
+ function webView(text2, url2, options) {
106
110
  return {
107
111
  _: "keyboardButtonWebView",
108
112
  text: text2,
109
- url: url2
113
+ url: url2,
114
+ style: options?.style
110
115
  };
111
116
  }
112
- function userProfile(text2, user) {
117
+ function userProfile(text2, user, options) {
113
118
  return {
114
119
  _: "inputKeyboardButtonUserProfile",
115
120
  text: text2,
116
- userId: peerUtils.toInputUser(user)
121
+ userId: peerUtils.toInputUser(user),
122
+ style: options?.style
117
123
  };
118
124
  }
119
125
  function requestPeer(text2, buttonId, params) {
@@ -122,14 +128,16 @@ function requestPeer(text2, buttonId, params) {
122
128
  text: text2,
123
129
  buttonId,
124
130
  peerType: params.peerType,
125
- maxQuantity: params.count ?? 1
131
+ maxQuantity: params.count ?? 1,
132
+ style: params.style
126
133
  };
127
134
  }
128
135
  function copy(params) {
129
136
  return {
130
137
  _: "keyboardButtonCopy",
131
138
  text: params.text,
132
- copyText: params?.copyText ?? params.text
139
+ copyText: params?.copyText ?? params.text,
140
+ style: params.style
133
141
  };
134
142
  }
135
143
  function findButton(buttons, predicate) {
@@ -73,7 +73,9 @@ export declare function requestPoll(text: string, quiz?: boolean): tl.RawKeyboar
73
73
  * @param text Button text
74
74
  * @param url URL
75
75
  */
76
- export declare function url(text: string, url: string): tl.RawKeyboardButtonUrl;
76
+ export declare function url(text: string, url: string, options?: {
77
+ style?: tl.RawKeyboardButtonStyle;
78
+ }): tl.RawKeyboardButtonUrl;
77
79
  /**
78
80
  * Create a keyboard button with a link.
79
81
  *
@@ -85,7 +87,10 @@ export declare function url(text: string, url: string): tl.RawKeyboardButtonUrl;
85
87
  * Whether the user should verify their identity by entering 2FA password.
86
88
  * See more: {@link tl.RawKeyboardButtonCallback#requiresPassword}
87
89
  */
88
- export declare function callback(text: string, data: string | Uint8Array, requiresPassword?: boolean): tl.RawKeyboardButtonCallback;
90
+ export declare function callback(text: string, data: string | Uint8Array, options?: {
91
+ requiresPassword?: boolean;
92
+ style?: tl.RawKeyboardButtonStyle;
93
+ }): tl.RawKeyboardButtonCallback;
89
94
  /**
90
95
  * Button to force a user to switch to inline mode.
91
96
  *
@@ -97,11 +102,19 @@ export declare function callback(text: string, data: string | Uint8Array, requir
97
102
  *
98
103
  * @param text Button text
99
104
  * @param query Inline query (can be empty or omitted)
100
- * @param currentChat
101
- * If set, pressing the button will insert the bot's username
102
- * and the specified inline query in the current chat's input field
103
105
  */
104
- export declare function switchInline(text: string, query?: string, currentChat?: boolean): tl.RawKeyboardButtonSwitchInline;
106
+ export declare function switchInline(text: string, options?: {
107
+ /**
108
+ * Inline query (can be empty or omitted)
109
+ */
110
+ query?: string;
111
+ /**
112
+ * If set, pressing the button will insert the bot's username
113
+ * and the specified inline query in the current chat's input field
114
+ */
115
+ currentChat?: boolean;
116
+ style?: tl.RawKeyboardButtonStyle;
117
+ }): tl.RawKeyboardButtonSwitchInline;
105
118
  /**
106
119
  * Button to start a game
107
120
  *
@@ -112,7 +125,9 @@ export declare function switchInline(text: string, query?: string, currentChat?:
112
125
  * game is inferred from {@link InputMedia.game},
113
126
  * thus this button should only be used with it.
114
127
  */
115
- export declare function game(text: string): tl.RawKeyboardButtonGame;
128
+ export declare function game(text: string, options?: {
129
+ style?: tl.RawKeyboardButtonStyle;
130
+ }): tl.RawKeyboardButtonGame;
116
131
  /**
117
132
  * Button to pay for a product.
118
133
  *
@@ -123,7 +138,9 @@ export declare function game(text: string): tl.RawKeyboardButtonGame;
123
138
  * invoice is inferred from {@link InputMedia.invoice},
124
139
  * thus this button should only be used with it.
125
140
  */
126
- export declare function pay(text: string): tl.RawKeyboardButtonBuy;
141
+ export declare function pay(text: string, options?: {
142
+ style?: tl.RawKeyboardButtonStyle;
143
+ }): tl.RawKeyboardButtonBuy;
127
144
  /**
128
145
  * Button to authorize a user
129
146
  *
@@ -143,6 +160,7 @@ export declare function urlAuth(text: string, url: string, params?: {
143
160
  * your bot to send messages to the user
144
161
  */
145
162
  requestWriteAccess?: boolean;
163
+ style?: tl.RawKeyboardButtonStyle;
146
164
  /**
147
165
  * Bot, which will be used for user authorization.
148
166
  * `url` domain must be the same as the domain linked
@@ -160,14 +178,18 @@ export declare function urlAuth(text: string, url: string, params?: {
160
178
  * @param text Button label
161
179
  * @param url WebView URL
162
180
  */
163
- export declare function webView(text: string, url: string): tl.RawKeyboardButtonWebView;
181
+ export declare function webView(text: string, url: string, options?: {
182
+ style?: tl.RawKeyboardButtonStyle;
183
+ }): tl.RawKeyboardButtonWebView;
164
184
  /**
165
185
  * Button to open user profile
166
186
  *
167
187
  * @param text Text of the button
168
188
  * @param user User to be opened (use {@link TelegramClient.resolvePeer})
169
189
  */
170
- export declare function userProfile(text: string, user: tl.TypeInputPeer): tl.RawInputKeyboardButtonUserProfile;
190
+ export declare function userProfile(text: string, user: tl.TypeInputPeer, options?: {
191
+ style?: tl.RawKeyboardButtonStyle;
192
+ }): tl.RawInputKeyboardButtonUserProfile;
171
193
  /**
172
194
  * Button to request a peer from the user
173
195
  *
@@ -185,6 +207,7 @@ export declare function requestPeer(text: string, buttonId: number, params: {
185
207
  * @default 1
186
208
  */
187
209
  count?: number;
210
+ style?: tl.RawKeyboardButtonStyle;
188
211
  }): tl.RawKeyboardButtonRequestPeer;
189
212
  /**
190
213
  * Button to copy text to the user's clipboard
@@ -192,6 +215,7 @@ export declare function requestPeer(text: string, buttonId: number, params: {
192
215
  export declare function copy(params: {
193
216
  text: string;
194
217
  copyText?: string;
218
+ style?: tl.RawKeyboardButtonStyle;
195
219
  }): tl.RawKeyboardButtonCopy;
196
220
  /**
197
221
  * Find a button in the keyboard by its text or by predicate
@@ -73,7 +73,9 @@ export declare function requestPoll(text: string, quiz?: boolean): tl.RawKeyboar
73
73
  * @param text Button text
74
74
  * @param url URL
75
75
  */
76
- export declare function url(text: string, url: string): tl.RawKeyboardButtonUrl;
76
+ export declare function url(text: string, url: string, options?: {
77
+ style?: tl.RawKeyboardButtonStyle;
78
+ }): tl.RawKeyboardButtonUrl;
77
79
  /**
78
80
  * Create a keyboard button with a link.
79
81
  *
@@ -85,7 +87,10 @@ export declare function url(text: string, url: string): tl.RawKeyboardButtonUrl;
85
87
  * Whether the user should verify their identity by entering 2FA password.
86
88
  * See more: {@link tl.RawKeyboardButtonCallback#requiresPassword}
87
89
  */
88
- export declare function callback(text: string, data: string | Uint8Array, requiresPassword?: boolean): tl.RawKeyboardButtonCallback;
90
+ export declare function callback(text: string, data: string | Uint8Array, options?: {
91
+ requiresPassword?: boolean;
92
+ style?: tl.RawKeyboardButtonStyle;
93
+ }): tl.RawKeyboardButtonCallback;
89
94
  /**
90
95
  * Button to force a user to switch to inline mode.
91
96
  *
@@ -97,11 +102,19 @@ export declare function callback(text: string, data: string | Uint8Array, requir
97
102
  *
98
103
  * @param text Button text
99
104
  * @param query Inline query (can be empty or omitted)
100
- * @param currentChat
101
- * If set, pressing the button will insert the bot's username
102
- * and the specified inline query in the current chat's input field
103
105
  */
104
- export declare function switchInline(text: string, query?: string, currentChat?: boolean): tl.RawKeyboardButtonSwitchInline;
106
+ export declare function switchInline(text: string, options?: {
107
+ /**
108
+ * Inline query (can be empty or omitted)
109
+ */
110
+ query?: string;
111
+ /**
112
+ * If set, pressing the button will insert the bot's username
113
+ * and the specified inline query in the current chat's input field
114
+ */
115
+ currentChat?: boolean;
116
+ style?: tl.RawKeyboardButtonStyle;
117
+ }): tl.RawKeyboardButtonSwitchInline;
105
118
  /**
106
119
  * Button to start a game
107
120
  *
@@ -112,7 +125,9 @@ export declare function switchInline(text: string, query?: string, currentChat?:
112
125
  * game is inferred from {@link InputMedia.game},
113
126
  * thus this button should only be used with it.
114
127
  */
115
- export declare function game(text: string): tl.RawKeyboardButtonGame;
128
+ export declare function game(text: string, options?: {
129
+ style?: tl.RawKeyboardButtonStyle;
130
+ }): tl.RawKeyboardButtonGame;
116
131
  /**
117
132
  * Button to pay for a product.
118
133
  *
@@ -123,7 +138,9 @@ export declare function game(text: string): tl.RawKeyboardButtonGame;
123
138
  * invoice is inferred from {@link InputMedia.invoice},
124
139
  * thus this button should only be used with it.
125
140
  */
126
- export declare function pay(text: string): tl.RawKeyboardButtonBuy;
141
+ export declare function pay(text: string, options?: {
142
+ style?: tl.RawKeyboardButtonStyle;
143
+ }): tl.RawKeyboardButtonBuy;
127
144
  /**
128
145
  * Button to authorize a user
129
146
  *
@@ -143,6 +160,7 @@ export declare function urlAuth(text: string, url: string, params?: {
143
160
  * your bot to send messages to the user
144
161
  */
145
162
  requestWriteAccess?: boolean;
163
+ style?: tl.RawKeyboardButtonStyle;
146
164
  /**
147
165
  * Bot, which will be used for user authorization.
148
166
  * `url` domain must be the same as the domain linked
@@ -160,14 +178,18 @@ export declare function urlAuth(text: string, url: string, params?: {
160
178
  * @param text Button label
161
179
  * @param url WebView URL
162
180
  */
163
- export declare function webView(text: string, url: string): tl.RawKeyboardButtonWebView;
181
+ export declare function webView(text: string, url: string, options?: {
182
+ style?: tl.RawKeyboardButtonStyle;
183
+ }): tl.RawKeyboardButtonWebView;
164
184
  /**
165
185
  * Button to open user profile
166
186
  *
167
187
  * @param text Text of the button
168
188
  * @param user User to be opened (use {@link TelegramClient.resolvePeer})
169
189
  */
170
- export declare function userProfile(text: string, user: tl.TypeInputPeer): tl.RawInputKeyboardButtonUserProfile;
190
+ export declare function userProfile(text: string, user: tl.TypeInputPeer, options?: {
191
+ style?: tl.RawKeyboardButtonStyle;
192
+ }): tl.RawInputKeyboardButtonUserProfile;
171
193
  /**
172
194
  * Button to request a peer from the user
173
195
  *
@@ -185,6 +207,7 @@ export declare function requestPeer(text: string, buttonId: number, params: {
185
207
  * @default 1
186
208
  */
187
209
  count?: number;
210
+ style?: tl.RawKeyboardButtonStyle;
188
211
  }): tl.RawKeyboardButtonRequestPeer;
189
212
  /**
190
213
  * Button to copy text to the user's clipboard
@@ -192,6 +215,7 @@ export declare function requestPeer(text: string, buttonId: number, params: {
192
215
  export declare function copy(params: {
193
216
  text: string;
194
217
  copyText?: string;
218
+ style?: tl.RawKeyboardButtonStyle;
195
219
  }): tl.RawKeyboardButtonCopy;
196
220
  /**
197
221
  * Find a button in the keyboard by its text or by predicate
@@ -54,34 +54,37 @@ function requestPoll(text2, quiz) {
54
54
  quiz
55
55
  };
56
56
  }
57
- function url(text2, url2) {
57
+ function url(text2, url2, options) {
58
58
  return {
59
59
  _: "keyboardButtonUrl",
60
60
  text: text2,
61
- url: url2
61
+ url: url2,
62
+ style: options?.style
62
63
  };
63
64
  }
64
- function callback(text2, data, requiresPassword) {
65
+ function callback(text2, data, options) {
65
66
  return {
66
67
  _: "keyboardButtonCallback",
67
68
  text: text2,
68
- requiresPassword,
69
+ requiresPassword: options?.requiresPassword,
70
+ style: options?.style,
69
71
  data: typeof data === "string" ? utf8.encoder.encode(data) : data
70
72
  };
71
73
  }
72
- function switchInline(text2, query = "", currentChat) {
74
+ function switchInline(text2, options) {
73
75
  return {
74
76
  _: "keyboardButtonSwitchInline",
75
- samePeer: currentChat,
77
+ samePeer: options?.currentChat,
78
+ style: options?.style,
76
79
  text: text2,
77
- query
80
+ query: options?.query ?? ""
78
81
  };
79
82
  }
80
- function game(text2) {
81
- return { _: "keyboardButtonGame", text: text2 };
83
+ function game(text2, options) {
84
+ return { _: "keyboardButtonGame", text: text2, style: options?.style };
82
85
  }
83
- function pay(text2) {
84
- return { _: "keyboardButtonBuy", text: text2 };
86
+ function pay(text2, options) {
87
+ return { _: "keyboardButtonBuy", text: text2, style: options?.style };
85
88
  }
86
89
  function urlAuth(text2, url2, params = {}) {
87
90
  return {
@@ -92,21 +95,24 @@ function urlAuth(text2, url2, params = {}) {
92
95
  _: "inputUserSelf"
93
96
  },
94
97
  fwdText: params.fwdText,
95
- requestWriteAccess: params.requestWriteAccess
98
+ requestWriteAccess: params.requestWriteAccess,
99
+ style: params.style
96
100
  };
97
101
  }
98
- function webView(text2, url2) {
102
+ function webView(text2, url2, options) {
99
103
  return {
100
104
  _: "keyboardButtonWebView",
101
105
  text: text2,
102
- url: url2
106
+ url: url2,
107
+ style: options?.style
103
108
  };
104
109
  }
105
- function userProfile(text2, user) {
110
+ function userProfile(text2, user, options) {
106
111
  return {
107
112
  _: "inputKeyboardButtonUserProfile",
108
113
  text: text2,
109
- userId: toInputUser(user)
114
+ userId: toInputUser(user),
115
+ style: options?.style
110
116
  };
111
117
  }
112
118
  function requestPeer(text2, buttonId, params) {
@@ -115,14 +121,16 @@ function requestPeer(text2, buttonId, params) {
115
121
  text: text2,
116
122
  buttonId,
117
123
  peerType: params.peerType,
118
- maxQuantity: params.count ?? 1
124
+ maxQuantity: params.count ?? 1,
125
+ style: params.style
119
126
  };
120
127
  }
121
128
  function copy(params) {
122
129
  return {
123
130
  _: "keyboardButtonCopy",
124
131
  text: params.text,
125
- copyText: params?.copyText ?? params.text
132
+ copyText: params?.copyText ?? params.text,
133
+ style: params.style
126
134
  };
127
135
  }
128
136
  function findButton(buttons, predicate) {
@@ -9,6 +9,7 @@ const Long = require("long");
9
9
  const peerUtils = require("../../../utils/peer-utils.cjs");
10
10
  const photo = require("../media/photo.cjs");
11
11
  const peer = require("../peers/peer.cjs");
12
+ const user = require("../peers/user.cjs");
12
13
  const starGiftUnique = require("../premium/star-gift-unique.cjs");
13
14
  const starGift = require("../premium/star-gift.cjs");
14
15
  function _messageActionFromTl(act) {
@@ -332,6 +333,7 @@ function _messageActionFromTl(act) {
332
333
  canTransferAt: act.canTransferAt ? new Date(act.canTransferAt * 1e3) : void 0,
333
334
  canResellAt: act.canResellAt ? new Date(act.canResellAt * 1e3) : void 0,
334
335
  canExportAt: act.canExportAt ? new Date(act.canExportAt * 1e3) : void 0,
336
+ canCraftAt: act.canCraftAt ? new Date(act.canCraftAt * 1e3) : void 0,
335
337
  savedId: act.savedId,
336
338
  dropDetailsStars: act.dropOriginalDetailsStars
337
339
  };
@@ -341,6 +343,12 @@ function _messageActionFromTl(act) {
341
343
  ...common
342
344
  };
343
345
  }
346
+ if (act.craft) {
347
+ return {
348
+ type: "star_gift_crafted",
349
+ ...common
350
+ };
351
+ }
344
352
  if (act.fromOffer) {
345
353
  return {
346
354
  type: "star_gift_bought_offer",
@@ -418,6 +426,16 @@ function _messageActionFromTl(act) {
418
426
  gift: new starGiftUnique.StarGiftUnique(act.gift, this._peers),
419
427
  price: act.price
420
428
  };
429
+ case "messageActionNewCreatorPending":
430
+ return {
431
+ type: "new_creator_pending",
432
+ newCreator: new user.User(this._peers.user(act.newCreatorId))
433
+ };
434
+ case "messageActionChangeCreator":
435
+ return {
436
+ type: "change_creator",
437
+ newCreator: new user.User(this._peers.user(act.newCreatorId))
438
+ };
421
439
  default:
422
440
  return null;
423
441
  }
@@ -3,6 +3,7 @@ import { TextWithEntities } from '../misc/entities.js';
3
3
  import { Peer } from '../peers/peer.js';
4
4
  import { Message } from './message.js';
5
5
  import { Photo } from '../media/photo.js';
6
+ import { User } from '../peers/user.js';
6
7
  import { StarGiftUnique } from '../premium/star-gift-unique.js';
7
8
  import { StarGift } from '../premium/star-gift.js';
8
9
  /** Group was created */
@@ -469,6 +470,8 @@ interface StarGiftUniqueCommon {
469
470
  canResellAt?: Date;
470
471
  /** If the gift can be exported to blockchain, date when it will become available */
471
472
  canExportAt?: Date;
473
+ /** If the gift can be crafted, date when it will become available */
474
+ canCraftAt?: Date;
472
475
  /** Amount of stars needed to drop the original details */
473
476
  dropDetailsStars?: tl.Long;
474
477
  /** ID of the related saved profile gift */
@@ -478,6 +481,10 @@ interface StarGiftUniqueCommon {
478
481
  export interface ActionStarGiftUpgraded extends StarGiftUniqueCommon {
479
482
  readonly type: 'star_gift_upgraded';
480
483
  }
484
+ /** A star gift was crafted */
485
+ export interface ActionStarGiftCrafted extends StarGiftUniqueCommon {
486
+ readonly type: 'star_gift_crafted';
487
+ }
481
488
  /** A star gift was bought from a resale listing */
482
489
  export interface ActionStarGiftBoughtResale extends StarGiftUniqueCommon {
483
490
  readonly type: 'star_gift_bought_resale';
@@ -566,7 +573,19 @@ export interface ActionSuggestBirthday {
566
573
  /** Birthday */
567
574
  birthday: tl.RawBirthday;
568
575
  }
569
- export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | null;
576
+ /** Group creator has left the group, and a new creator has been assigned but not yet made one */
577
+ export interface ActionNewCreatorPending {
578
+ readonly type: 'new_creator_pending';
579
+ /** New creator */
580
+ newCreator: User;
581
+ }
582
+ /** Group creator has left the group, and a new creator has been assigned */
583
+ export interface ActionChangeCreator {
584
+ readonly type: 'change_creator';
585
+ /** New creator */
586
+ newCreator: User;
587
+ }
588
+ export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | ActionStarGiftCrafted | ActionNewCreatorPending | ActionChangeCreator | null;
570
589
  /** @internal */
571
590
  export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
572
591
  export {};
@@ -3,6 +3,7 @@ import { TextWithEntities } from '../misc/entities.js';
3
3
  import { Peer } from '../peers/peer.js';
4
4
  import { Message } from './message.js';
5
5
  import { Photo } from '../media/photo.js';
6
+ import { User } from '../peers/user.js';
6
7
  import { StarGiftUnique } from '../premium/star-gift-unique.js';
7
8
  import { StarGift } from '../premium/star-gift.js';
8
9
  /** Group was created */
@@ -469,6 +470,8 @@ interface StarGiftUniqueCommon {
469
470
  canResellAt?: Date;
470
471
  /** If the gift can be exported to blockchain, date when it will become available */
471
472
  canExportAt?: Date;
473
+ /** If the gift can be crafted, date when it will become available */
474
+ canCraftAt?: Date;
472
475
  /** Amount of stars needed to drop the original details */
473
476
  dropDetailsStars?: tl.Long;
474
477
  /** ID of the related saved profile gift */
@@ -478,6 +481,10 @@ interface StarGiftUniqueCommon {
478
481
  export interface ActionStarGiftUpgraded extends StarGiftUniqueCommon {
479
482
  readonly type: 'star_gift_upgraded';
480
483
  }
484
+ /** A star gift was crafted */
485
+ export interface ActionStarGiftCrafted extends StarGiftUniqueCommon {
486
+ readonly type: 'star_gift_crafted';
487
+ }
481
488
  /** A star gift was bought from a resale listing */
482
489
  export interface ActionStarGiftBoughtResale extends StarGiftUniqueCommon {
483
490
  readonly type: 'star_gift_bought_resale';
@@ -566,7 +573,19 @@ export interface ActionSuggestBirthday {
566
573
  /** Birthday */
567
574
  birthday: tl.RawBirthday;
568
575
  }
569
- export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | null;
576
+ /** Group creator has left the group, and a new creator has been assigned but not yet made one */
577
+ export interface ActionNewCreatorPending {
578
+ readonly type: 'new_creator_pending';
579
+ /** New creator */
580
+ newCreator: User;
581
+ }
582
+ /** Group creator has left the group, and a new creator has been assigned */
583
+ export interface ActionChangeCreator {
584
+ readonly type: 'change_creator';
585
+ /** New creator */
586
+ newCreator: User;
587
+ }
588
+ export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | ActionStarGiftCrafted | ActionNewCreatorPending | ActionChangeCreator | null;
570
589
  /** @internal */
571
590
  export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
572
591
  export {};
@@ -2,6 +2,7 @@ import Long from "long";
2
2
  import { getMarkedPeerId } from "../../../utils/peer-utils.js";
3
3
  import { Photo as Photo$2 } from "../media/photo.js";
4
4
  import { parsePeer } from "../peers/peer.js";
5
+ import { User as User$2 } from "../peers/user.js";
5
6
  import { StarGiftUnique as StarGiftUnique$2 } from "../premium/star-gift-unique.js";
6
7
  import { StarGift as StarGift$2 } from "../premium/star-gift.js";
7
8
  function _messageActionFromTl(act) {
@@ -325,6 +326,7 @@ function _messageActionFromTl(act) {
325
326
  canTransferAt: act.canTransferAt ? new Date(act.canTransferAt * 1e3) : void 0,
326
327
  canResellAt: act.canResellAt ? new Date(act.canResellAt * 1e3) : void 0,
327
328
  canExportAt: act.canExportAt ? new Date(act.canExportAt * 1e3) : void 0,
329
+ canCraftAt: act.canCraftAt ? new Date(act.canCraftAt * 1e3) : void 0,
328
330
  savedId: act.savedId,
329
331
  dropDetailsStars: act.dropOriginalDetailsStars
330
332
  };
@@ -334,6 +336,12 @@ function _messageActionFromTl(act) {
334
336
  ...common
335
337
  };
336
338
  }
339
+ if (act.craft) {
340
+ return {
341
+ type: "star_gift_crafted",
342
+ ...common
343
+ };
344
+ }
337
345
  if (act.fromOffer) {
338
346
  return {
339
347
  type: "star_gift_bought_offer",
@@ -411,6 +419,16 @@ function _messageActionFromTl(act) {
411
419
  gift: new StarGiftUnique$2(act.gift, this._peers),
412
420
  price: act.price
413
421
  };
422
+ case "messageActionNewCreatorPending":
423
+ return {
424
+ type: "new_creator_pending",
425
+ newCreator: new User$2(this._peers.user(act.newCreatorId))
426
+ };
427
+ case "messageActionChangeCreator":
428
+ return {
429
+ type: "change_creator",
430
+ newCreator: new User$2(this._peers.user(act.newCreatorId))
431
+ };
414
432
  default:
415
433
  return null;
416
434
  }
@@ -108,7 +108,7 @@ class Chat {
108
108
  case "channelForbidden":
109
109
  if (this.raw._ === "channel" && this.raw.gigagroup) {
110
110
  return "gigagroup";
111
- } else if (this.raw._ === "channel" && this.raw.monoforum) {
111
+ } else if (this.raw.monoforum) {
112
112
  return "monoforum";
113
113
  } else if (this.raw.broadcast) {
114
114
  return "channel";
@@ -101,7 +101,7 @@ class Chat {
101
101
  case "channelForbidden":
102
102
  if (this.raw._ === "channel" && this.raw.gigagroup) {
103
103
  return "gigagroup";
104
- } else if (this.raw._ === "channel" && this.raw.monoforum) {
104
+ } else if (this.raw.monoforum) {
105
105
  return "monoforum";
106
106
  } else if (this.raw.broadcast) {
107
107
  return "channel";