telegram-bot-api-nodejs 1.0.28 → 1.0.29
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 +22 -1
- package/index.js +8 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -100,6 +100,10 @@ export interface Update {
|
|
|
100
100
|
edited_message?: Message;
|
|
101
101
|
channel_post?: Message;
|
|
102
102
|
edited_channel_post?: Message;
|
|
103
|
+
business_connection?: BusinessConnection;
|
|
104
|
+
business_message?: Message;
|
|
105
|
+
edited_business_message?: Message;
|
|
106
|
+
deleted_business_messages?: BusinessMessagesDeleted;
|
|
103
107
|
message_reaction?: MessageReactionUpdated;
|
|
104
108
|
message_reaction_count?: MessageReactionCountUpdated;
|
|
105
109
|
inline_query?: InlineQuery;
|
|
@@ -129,8 +133,9 @@ export interface User {
|
|
|
129
133
|
language_code?: string;
|
|
130
134
|
is_premium: boolean;
|
|
131
135
|
can_join_groups?: boolean;
|
|
132
|
-
supports_inline_queries?: boolean;
|
|
133
136
|
can_read_all_group_messages?: boolean;
|
|
137
|
+
supports_inline_queries?: boolean;
|
|
138
|
+
can_connect_to_business?: boolean;
|
|
134
139
|
}
|
|
135
140
|
export interface Chat {
|
|
136
141
|
id: number;
|
|
@@ -247,6 +252,19 @@ export interface Message {
|
|
|
247
252
|
video_chat_ended: VideoChatEnded;
|
|
248
253
|
video_chat_participants_invited: VideoChatParticipantsInvited;
|
|
249
254
|
}
|
|
255
|
+
export interface BusinessConnection {
|
|
256
|
+
id: string;
|
|
257
|
+
user: User;
|
|
258
|
+
user_chat_id: number;
|
|
259
|
+
date: number;
|
|
260
|
+
can_reply: boolean;
|
|
261
|
+
is_enabled: boolean;
|
|
262
|
+
}
|
|
263
|
+
export interface BusinessMessagesDeleted {
|
|
264
|
+
business_connection_id: string;
|
|
265
|
+
chat: Chat;
|
|
266
|
+
message_ids: number[];
|
|
267
|
+
}
|
|
250
268
|
export interface MessageReactionUpdated {
|
|
251
269
|
chat: Chat;
|
|
252
270
|
message_id: number;
|
|
@@ -723,6 +741,9 @@ export declare function getChatMember(token: string, payload: {
|
|
|
723
741
|
export declare function setMyCommands(token: string, payload: SetMyCommandsOptions, signal?: AbortSignal): Promise<void>;
|
|
724
742
|
export declare function getMyCommands(token: string, payload?: GetMyCommandsOptions, signal?: AbortSignal): Promise<BotCommand[]>;
|
|
725
743
|
export declare function deleteMyCommands(token: string, payload: DeleteMyCommandsOptions, signal: AbortSignal): Promise<Chat>;
|
|
744
|
+
export declare function getBusinessConnection(token: string, payload: {
|
|
745
|
+
business_connection_id: string;
|
|
746
|
+
}, signal: AbortSignal): Promise<BusinessConnection>;
|
|
726
747
|
/**
|
|
727
748
|
* Parsers
|
|
728
749
|
*/
|
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
|
*/
|