telegram-bot-api-nodejs 1.0.28 → 1.0.30
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/index.d.ts +26 -1
- package/index.js +8 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface SetWebHookOptions {
|
|
|
13
13
|
}
|
|
14
14
|
interface SendBasicOptions {
|
|
15
15
|
chat_id: number | string;
|
|
16
|
+
business_connection_id?: string;
|
|
16
17
|
message_thread_id?: number;
|
|
17
18
|
disable_notification?: boolean;
|
|
18
19
|
reply_to_message_id?: number | string;
|
|
@@ -100,6 +101,10 @@ export interface Update {
|
|
|
100
101
|
edited_message?: Message;
|
|
101
102
|
channel_post?: Message;
|
|
102
103
|
edited_channel_post?: Message;
|
|
104
|
+
business_connection?: BusinessConnection;
|
|
105
|
+
business_message?: Message;
|
|
106
|
+
edited_business_message?: Message;
|
|
107
|
+
deleted_business_messages?: BusinessMessagesDeleted;
|
|
103
108
|
message_reaction?: MessageReactionUpdated;
|
|
104
109
|
message_reaction_count?: MessageReactionCountUpdated;
|
|
105
110
|
inline_query?: InlineQuery;
|
|
@@ -129,8 +134,9 @@ export interface User {
|
|
|
129
134
|
language_code?: string;
|
|
130
135
|
is_premium: boolean;
|
|
131
136
|
can_join_groups?: boolean;
|
|
132
|
-
supports_inline_queries?: boolean;
|
|
133
137
|
can_read_all_group_messages?: boolean;
|
|
138
|
+
supports_inline_queries?: boolean;
|
|
139
|
+
can_connect_to_business?: boolean;
|
|
134
140
|
}
|
|
135
141
|
export interface Chat {
|
|
136
142
|
id: number;
|
|
@@ -184,7 +190,9 @@ export interface Message {
|
|
|
184
190
|
message_id: number;
|
|
185
191
|
message_thread_id?: number;
|
|
186
192
|
from?: User;
|
|
193
|
+
sender_business_bot?: User;
|
|
187
194
|
date: number;
|
|
195
|
+
business_connection_id?: string;
|
|
188
196
|
chat: Chat;
|
|
189
197
|
via_bot?: User;
|
|
190
198
|
forward_from?: User;
|
|
@@ -197,6 +205,7 @@ export interface Message {
|
|
|
197
205
|
is_automatic_forward?: boolean;
|
|
198
206
|
reply_to_message?: Message;
|
|
199
207
|
edit_date?: number;
|
|
208
|
+
is_from_offline?: boolean;
|
|
200
209
|
media_group_id?: string;
|
|
201
210
|
author_signature?: string;
|
|
202
211
|
text?: string;
|
|
@@ -247,6 +256,19 @@ export interface Message {
|
|
|
247
256
|
video_chat_ended: VideoChatEnded;
|
|
248
257
|
video_chat_participants_invited: VideoChatParticipantsInvited;
|
|
249
258
|
}
|
|
259
|
+
export interface BusinessConnection {
|
|
260
|
+
id: string;
|
|
261
|
+
user: User;
|
|
262
|
+
user_chat_id: number;
|
|
263
|
+
date: number;
|
|
264
|
+
can_reply: boolean;
|
|
265
|
+
is_enabled: boolean;
|
|
266
|
+
}
|
|
267
|
+
export interface BusinessMessagesDeleted {
|
|
268
|
+
business_connection_id: string;
|
|
269
|
+
chat: Chat;
|
|
270
|
+
message_ids: number[];
|
|
271
|
+
}
|
|
250
272
|
export interface MessageReactionUpdated {
|
|
251
273
|
chat: Chat;
|
|
252
274
|
message_id: number;
|
|
@@ -723,6 +745,9 @@ export declare function getChatMember(token: string, payload: {
|
|
|
723
745
|
export declare function setMyCommands(token: string, payload: SetMyCommandsOptions, signal?: AbortSignal): Promise<void>;
|
|
724
746
|
export declare function getMyCommands(token: string, payload?: GetMyCommandsOptions, signal?: AbortSignal): Promise<BotCommand[]>;
|
|
725
747
|
export declare function deleteMyCommands(token: string, payload: DeleteMyCommandsOptions, signal: AbortSignal): Promise<Chat>;
|
|
748
|
+
export declare function getBusinessConnection(token: string, payload: {
|
|
749
|
+
business_connection_id: string;
|
|
750
|
+
}, signal: AbortSignal): Promise<BusinessConnection>;
|
|
726
751
|
/**
|
|
727
752
|
* Parsers
|
|
728
753
|
*/
|
package/index.js
CHANGED
|
@@ -182,6 +182,14 @@ export function deleteMyCommands(token, payload, signal) {
|
|
|
182
182
|
signal
|
|
183
183
|
}).then((parseResponse));
|
|
184
184
|
}
|
|
185
|
+
export function getBusinessConnection(token, payload, signal) {
|
|
186
|
+
return fetch(`https://api.telegram.org/bot${token}/getBusinessConnection`, {
|
|
187
|
+
method: "POST",
|
|
188
|
+
body: JSON.stringify(payload),
|
|
189
|
+
headers,
|
|
190
|
+
signal
|
|
191
|
+
}).then((parseResponse));
|
|
192
|
+
}
|
|
185
193
|
/**
|
|
186
194
|
* Parsers
|
|
187
195
|
*/
|