telegram-bot-api-nodejs 1.0.27 → 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 +27 -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;
|
|
@@ -214,6 +219,7 @@ export interface Message {
|
|
|
214
219
|
video_note?: VideoNote;
|
|
215
220
|
caption?: string;
|
|
216
221
|
contact?: Contact;
|
|
222
|
+
dice?: Dice;
|
|
217
223
|
location?: Location;
|
|
218
224
|
venue?: Venue;
|
|
219
225
|
poll?: Poll;
|
|
@@ -246,6 +252,19 @@ export interface Message {
|
|
|
246
252
|
video_chat_ended: VideoChatEnded;
|
|
247
253
|
video_chat_participants_invited: VideoChatParticipantsInvited;
|
|
248
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
|
+
}
|
|
249
268
|
export interface MessageReactionUpdated {
|
|
250
269
|
chat: Chat;
|
|
251
270
|
message_id: number;
|
|
@@ -383,6 +402,10 @@ export interface Contact {
|
|
|
383
402
|
user_id?: number;
|
|
384
403
|
vcard?: string;
|
|
385
404
|
}
|
|
405
|
+
export interface Dice {
|
|
406
|
+
emoji: string;
|
|
407
|
+
value: string;
|
|
408
|
+
}
|
|
386
409
|
export interface Location {
|
|
387
410
|
longitude: number;
|
|
388
411
|
latitude: number;
|
|
@@ -718,6 +741,9 @@ export declare function getChatMember(token: string, payload: {
|
|
|
718
741
|
export declare function setMyCommands(token: string, payload: SetMyCommandsOptions, signal?: AbortSignal): Promise<void>;
|
|
719
742
|
export declare function getMyCommands(token: string, payload?: GetMyCommandsOptions, signal?: AbortSignal): Promise<BotCommand[]>;
|
|
720
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>;
|
|
721
747
|
/**
|
|
722
748
|
* Parsers
|
|
723
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
|
*/
|