@mtkruto/node 0.2.37 → 0.2.41
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/esm/3_types.d.ts +1 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +1 -0
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/0_params.d.ts +17 -3
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.js +2 -2
- package/esm/client/0_utilities.d.ts +1 -0
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +13 -0
- package/esm/client/1_client_encrypted.d.ts.map +1 -1
- package/esm/client/1_client_encrypted.js +3 -0
- package/esm/client/2_update_manager.js +5 -5
- package/esm/client/3_message_manager.js +8 -8
- package/esm/client/5_client.d.ts +4 -0
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +56 -33
- package/esm/tl/0_api.d.ts +173 -16
- package/esm/tl/0_api.d.ts.map +1 -1
- package/esm/tl/0_api.js +279 -34
- package/esm/tl/1_utilities.d.ts +1 -1
- package/esm/tl/1_utilities.d.ts.map +1 -1
- package/esm/tl/1_utilities.js +13 -1
- package/esm/types/0_reaction.d.ts +15 -6
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_reaction.js +4 -4
- package/esm/types/0_refunded_payment.d.ts +6 -0
- package/esm/types/0_refunded_payment.d.ts.map +1 -1
- package/esm/types/0_switch_inline_query_chosen_chats.d.ts +13 -0
- package/esm/types/0_switch_inline_query_chosen_chats.d.ts.map +1 -0
- package/esm/types/0_switch_inline_query_chosen_chats.js +1 -0
- package/esm/types/1_giveaway.d.ts +3 -1
- package/esm/types/1_giveaway.d.ts.map +1 -1
- package/esm/types/1_giveaway.js +4 -2
- package/esm/types/2_chat.d.ts +1 -0
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_forward_header.d.ts +40 -0
- package/esm/types/2_forward_header.d.ts.map +1 -0
- package/esm/types/2_forward_header.js +55 -0
- package/esm/types/2_inline_keyboard_button.d.ts +61 -14
- package/esm/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/esm/types/4_message.d.ts +9 -14
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +5 -25
- package/esm/types/6_update.d.ts +29 -2
- package/esm/types/6_update.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +1 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +1 -0
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/0_params.d.ts +17 -3
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.js +2 -2
- package/script/client/0_utilities.d.ts +1 -0
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +15 -1
- package/script/client/1_client_encrypted.d.ts.map +1 -1
- package/script/client/1_client_encrypted.js +3 -0
- package/script/client/2_update_manager.js +5 -5
- package/script/client/3_message_manager.js +8 -8
- package/script/client/5_client.d.ts +4 -0
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +55 -32
- package/script/tl/0_api.d.ts +173 -16
- package/script/tl/0_api.d.ts.map +1 -1
- package/script/tl/0_api.js +279 -34
- package/script/tl/1_utilities.d.ts +1 -1
- package/script/tl/1_utilities.d.ts.map +1 -1
- package/script/tl/1_utilities.js +13 -1
- package/script/types/0_reaction.d.ts +15 -6
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_reaction.js +4 -4
- package/script/types/0_refunded_payment.d.ts +6 -0
- package/script/types/0_refunded_payment.d.ts.map +1 -1
- package/script/types/0_switch_inline_query_chosen_chats.d.ts +13 -0
- package/script/types/0_switch_inline_query_chosen_chats.d.ts.map +1 -0
- package/script/types/0_switch_inline_query_chosen_chats.js +2 -0
- package/script/types/1_giveaway.d.ts +3 -1
- package/script/types/1_giveaway.d.ts.map +1 -1
- package/script/types/1_giveaway.js +4 -2
- package/script/types/2_chat.d.ts +1 -0
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_forward_header.d.ts +40 -0
- package/script/types/2_forward_header.d.ts.map +1 -0
- package/script/types/2_forward_header.js +59 -0
- package/script/types/2_inline_keyboard_button.d.ts +61 -14
- package/script/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/script/types/4_message.d.ts +9 -14
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +5 -25
- package/script/types/6_update.d.ts +29 -2
- package/script/types/6_update.d.ts.map +1 -1
|
@@ -18,22 +18,31 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* A regular reaction.
|
|
23
|
+
* @unlisted
|
|
24
|
+
*/
|
|
22
25
|
export interface ReactionEmoji {
|
|
23
26
|
type: "emoji";
|
|
24
27
|
emoji: string;
|
|
25
28
|
}
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* A custom reaction.
|
|
31
|
+
* @unlisted
|
|
32
|
+
*/
|
|
33
|
+
export interface ReactionCustom {
|
|
34
|
+
type: "custom";
|
|
29
35
|
id: string;
|
|
30
36
|
}
|
|
31
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* A paid (star) reaction.
|
|
39
|
+
* @unlisted
|
|
40
|
+
*/
|
|
32
41
|
export interface ReactionPaid {
|
|
33
42
|
type: "paid";
|
|
34
43
|
}
|
|
35
44
|
/** A reaction type. */
|
|
36
|
-
export type Reaction = ReactionEmoji |
|
|
45
|
+
export type Reaction = ReactionEmoji | ReactionCustom | ReactionPaid;
|
|
37
46
|
export declare function constructReaction(reaction: Api.Reaction): Reaction;
|
|
38
47
|
export declare function reactionToTlObject(reaction: Reaction): Api.Reaction;
|
|
39
48
|
export declare function reactionEqual(left: Reaction, right: Reaction): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_reaction.d.ts","sourceRoot":"","sources":["../../src/types/0_reaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AAErC
|
|
1
|
+
{"version":3,"file":"0_reaction.d.ts","sourceRoot":"","sources":["../../src/types/0_reaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,uBAAuB;AACvB,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,cAAc,GAAG,YAAY,CAAC;AAErE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAUlE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAEnE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAWtE"}
|
package/esm/types/0_reaction.js
CHANGED
|
@@ -24,7 +24,7 @@ export function constructReaction(reaction) {
|
|
|
24
24
|
return { type: "emoji", emoji: reaction.emoticon };
|
|
25
25
|
}
|
|
26
26
|
else if (is("reactionCustomEmoji", reaction)) {
|
|
27
|
-
return { type: "
|
|
27
|
+
return { type: "custom", id: String(reaction.document_id) };
|
|
28
28
|
}
|
|
29
29
|
else if (is("reactionPaid", reaction)) {
|
|
30
30
|
return { type: "paid" };
|
|
@@ -34,7 +34,7 @@ export function constructReaction(reaction) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
export function reactionToTlObject(reaction) {
|
|
37
|
-
return reaction.type == "emoji" ? ({ _: "reactionEmoji", emoticon: reaction.emoji }) : reaction.type == "
|
|
37
|
+
return reaction.type == "emoji" ? ({ _: "reactionEmoji", emoticon: reaction.emoji }) : reaction.type == "custom" ? ({ _: "reactionCustomEmoji", document_id: BigInt(reaction.id) }) : { _: "reactionPaid" };
|
|
38
38
|
}
|
|
39
39
|
export function reactionEqual(left, right) {
|
|
40
40
|
if (left.type == "emoji") {
|
|
@@ -42,8 +42,8 @@ export function reactionEqual(left, right) {
|
|
|
42
42
|
return true;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
else if (left.type == "
|
|
46
|
-
if (right.type == "
|
|
45
|
+
else if (left.type == "custom") {
|
|
46
|
+
if (right.type == "custom" && left.id == right.id) {
|
|
47
47
|
return true;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -18,11 +18,17 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
|
+
/** Information on a refunded payment. */
|
|
21
22
|
export interface RefundedPayment {
|
|
23
|
+
/** The payment's currency. */
|
|
22
24
|
currency: string;
|
|
25
|
+
/** The payment's total amount. */
|
|
23
26
|
totalAmount: number;
|
|
27
|
+
/** The payload of the payment's invoice. */
|
|
24
28
|
invoicePayload: string;
|
|
29
|
+
/** Telegram identifier of the payment. */
|
|
25
30
|
telegramPaymentChargeId: string;
|
|
31
|
+
/** Payment provider identifier of the payment. */
|
|
26
32
|
providerPaymentChargeId?: string;
|
|
27
33
|
}
|
|
28
34
|
export declare function constructRefundedPayment(action: Api.messageActionPaymentRefunded): RefundedPayment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_refunded_payment.d.ts","sourceRoot":"","sources":["../../src/types/0_refunded_payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,4BAA4B,GAAG,eAAe,CAQlG"}
|
|
1
|
+
{"version":3,"file":"0_refunded_payment.d.ts","sourceRoot":"","sources":["../../src/types/0_refunded_payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,yCAAyC;AACzC,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,uBAAuB,EAAE,MAAM,CAAC;IAChC,kDAAkD;IAClD,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,4BAA4B,GAAG,eAAe,CAQlG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface SwitchInlineQueryChosenChats {
|
|
2
|
+
/** The query to type into the user's message box once switched to inline. */
|
|
3
|
+
query: string;
|
|
4
|
+
/** Whether the user should be allowed to pick chats with users. */
|
|
5
|
+
allowUsers?: boolean;
|
|
6
|
+
/** Whether the user should be allowed to pick chats with bots. */
|
|
7
|
+
allowBots?: boolean;
|
|
8
|
+
/** Whether the user should be allowed to pick group chats. */
|
|
9
|
+
allowGroups?: boolean;
|
|
10
|
+
/** Whether the user should be allowed to pick channels. */
|
|
11
|
+
allowChannels?: boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=0_switch_inline_query_chosen_chats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_switch_inline_query_chosen_chats.d.ts","sourceRoot":"","sources":["../../src/types/0_switch_inline_query_chosen_chats.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IAC3C,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -25,7 +25,9 @@ export interface Giveaway {
|
|
|
25
25
|
/** The quantity of the Telegram Premium subscriptions that will be given away.. */
|
|
26
26
|
winnerCount: number;
|
|
27
27
|
/** The duration of each Telegram Premium subscription that is to be given away in months. */
|
|
28
|
-
|
|
28
|
+
premiumMonthCount?: number;
|
|
29
|
+
/** The amount of Telegram Stars that is to be given away to each user. */
|
|
30
|
+
starCount?: number;
|
|
29
31
|
}
|
|
30
32
|
export declare function constructGiveaway(g: Api.messageMediaGiveaway): Giveaway;
|
|
31
33
|
//# sourceMappingURL=1_giveaway.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_giveaway.d.ts","sourceRoot":"","sources":["../../src/types/1_giveaway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"1_giveaway.d.ts","sourceRoot":"","sources":["../../src/types/1_giveaway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA+B,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAE7F,kBAAkB;AAClB,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,mFAAmF;IACnF,WAAW,EAAE,MAAM,CAAC;IACpB,6FAA6F;IAC7F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,GAAG,CAAC,oBAAoB,GAAG,QAAQ,CAMvE"}
|
package/esm/types/1_giveaway.js
CHANGED
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
+
import { cleanObject } from "../1_utilities.js";
|
|
20
21
|
import { constructGiveawayParameters } from "./0_giveaway_parameters.js";
|
|
21
22
|
export function constructGiveaway(g) {
|
|
22
23
|
const winnerCount = g.quantity;
|
|
23
|
-
const
|
|
24
|
+
const premiumMonthCount = g.months;
|
|
25
|
+
const starCount = g.stars;
|
|
24
26
|
const parameters = constructGiveawayParameters(g);
|
|
25
|
-
return { parameters, winnerCount,
|
|
27
|
+
return cleanObject({ parameters, winnerCount, premiumMonthCount, starCount: starCount ? Number(starCount) : undefined });
|
|
26
28
|
}
|
package/esm/types/2_chat.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_chat.d.ts","sourceRoot":"","sources":["../../src/types/2_chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,e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EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,yCAAyC;IACzC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qDAAqD;IACrD,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,WAAW,GAAG,cAAc,GAAG,SAAS,GAAG,WAAW,CAAC;AAE1E,wBAAsB,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAmCnI"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Api } from "../2_tl.js";
|
|
2
|
+
import { EntityGetter } from "./_getters.js";
|
|
3
|
+
import { ChatPChannel, ChatPSupergroup } from "./1_chat_p.js";
|
|
4
|
+
import { User } from "./1_user.js";
|
|
5
|
+
/** @unlisted */
|
|
6
|
+
export interface _ForwardHeaderCommon {
|
|
7
|
+
date: Date;
|
|
8
|
+
}
|
|
9
|
+
/** @unlisted */
|
|
10
|
+
export interface ForwardHeaderUser extends _ForwardHeaderCommon {
|
|
11
|
+
/** @discriminator */
|
|
12
|
+
type: "user";
|
|
13
|
+
user: User;
|
|
14
|
+
}
|
|
15
|
+
/** @unlisted */
|
|
16
|
+
export interface ForwardHeaderChannel extends _ForwardHeaderCommon {
|
|
17
|
+
/** @discriminator */
|
|
18
|
+
type: "channel";
|
|
19
|
+
chat: ChatPChannel;
|
|
20
|
+
messageId: number;
|
|
21
|
+
authorSignature?: string;
|
|
22
|
+
}
|
|
23
|
+
/** @unlisted */
|
|
24
|
+
export interface ForwardHeaderSupergroup extends _ForwardHeaderCommon {
|
|
25
|
+
type: "supergroup";
|
|
26
|
+
chat: ChatPSupergroup;
|
|
27
|
+
title?: string;
|
|
28
|
+
}
|
|
29
|
+
/** @unlisted */
|
|
30
|
+
export interface ForwardHeaderHidden extends _ForwardHeaderCommon {
|
|
31
|
+
type: "hidden";
|
|
32
|
+
name: string;
|
|
33
|
+
}
|
|
34
|
+
/** @unlisted */
|
|
35
|
+
export interface ForwardHeaderUnsupported extends _ForwardHeaderCommon {
|
|
36
|
+
type: "unsupported";
|
|
37
|
+
}
|
|
38
|
+
export type ForwardHeader = ForwardHeaderUser | ForwardHeaderChannel | ForwardHeaderSupergroup | ForwardHeaderHidden | ForwardHeaderUnsupported;
|
|
39
|
+
export declare function constructForwardHeader(fwdHeader: Api.MessageFwdHeader, getEntity: EntityGetter): Promise<ForwardHeader>;
|
|
40
|
+
//# sourceMappingURL=2_forward_header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2_forward_header.d.ts","sourceRoot":"","sources":["../../src/types/2_forward_header.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD,gBAAgB;AAChB,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,gBAAgB;AAChB,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC7D,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,gBAAgB;AAChB,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,qBAAqB;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gBAAgB;AAChB,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IACnE,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,uBAAuB,GAAG,mBAAmB,GAAG,wBAAwB,CAAC;AAEhJ,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,GAAG,CAAC,gBAAgB,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CA8C7H"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { unreachable } from "../0_deps.js";
|
|
2
|
+
import { cleanObject, fromUnixTimestamp } from "../1_utilities.js";
|
|
3
|
+
import { constructChatP } from "../3_types.js";
|
|
4
|
+
import { constructUser } from "./1_user.js";
|
|
5
|
+
export async function constructForwardHeader(fwdHeader, getEntity) {
|
|
6
|
+
if (fwdHeader.channel_post && fwdHeader.from_id?._ == "peerChannel") {
|
|
7
|
+
const chat = await getEntity(fwdHeader.from_id);
|
|
8
|
+
if (chat == null) {
|
|
9
|
+
unreachable();
|
|
10
|
+
}
|
|
11
|
+
return cleanObject({
|
|
12
|
+
type: "channel",
|
|
13
|
+
date: fromUnixTimestamp(fwdHeader.date),
|
|
14
|
+
chat: constructChatP(chat),
|
|
15
|
+
messageId: fwdHeader.channel_post,
|
|
16
|
+
authorSignature: fwdHeader.post_author,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else if (fwdHeader.from_id?._ == "peerChannel") {
|
|
20
|
+
const chat = await getEntity(fwdHeader.from_id);
|
|
21
|
+
if (chat == null) {
|
|
22
|
+
unreachable();
|
|
23
|
+
}
|
|
24
|
+
return cleanObject({
|
|
25
|
+
type: "supergroup",
|
|
26
|
+
date: fromUnixTimestamp(fwdHeader.date),
|
|
27
|
+
chat: constructChatP(chat),
|
|
28
|
+
title: fwdHeader.post_author,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
else if (fwdHeader.from_id?._ == "peerUser") {
|
|
32
|
+
const user = await getEntity(fwdHeader.from_id);
|
|
33
|
+
if (user == null) {
|
|
34
|
+
unreachable();
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
type: "user",
|
|
38
|
+
date: fromUnixTimestamp(fwdHeader.date),
|
|
39
|
+
user: constructUser(user),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
else if (fwdHeader.from_name) {
|
|
43
|
+
return {
|
|
44
|
+
type: "hidden",
|
|
45
|
+
date: fromUnixTimestamp(fwdHeader.date),
|
|
46
|
+
name: fwdHeader.from_name,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return {
|
|
51
|
+
type: "unsupported",
|
|
52
|
+
date: fromUnixTimestamp(fwdHeader.date),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -23,39 +23,80 @@ import { LoginUrl } from "./0_login_url.js";
|
|
|
23
23
|
import { MiniAppInfo } from "./0_mini_app_info.js";
|
|
24
24
|
/** @unlisted */
|
|
25
25
|
export interface _InlineKeyboardButtonBase {
|
|
26
|
+
/** The text of the button. */
|
|
26
27
|
text: string;
|
|
27
28
|
}
|
|
28
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* An inline keyboard button that, when pressed, opens the specified URL.
|
|
31
|
+
* @unlisted
|
|
32
|
+
*/
|
|
29
33
|
export interface InlineKeyboardButtonURL extends _InlineKeyboardButtonBase {
|
|
30
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The URL to open.
|
|
36
|
+
* @discriminator
|
|
37
|
+
*/
|
|
31
38
|
url: string;
|
|
32
39
|
}
|
|
33
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* An inline keyboard button that, when pressed, sends back the specified callback data.
|
|
42
|
+
* @unlisted
|
|
43
|
+
*/
|
|
34
44
|
export interface InlineKeyboardButtonCallback extends _InlineKeyboardButtonBase {
|
|
35
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* The callback data to send back.
|
|
47
|
+
* @discriminator
|
|
48
|
+
*/
|
|
36
49
|
callbackData: string;
|
|
37
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* An inline keyboard button that, when pressed, launches the specified mini app.
|
|
53
|
+
* @unlisted
|
|
54
|
+
*/
|
|
38
55
|
/** @unlisted */
|
|
39
56
|
export interface InlineKeyboardButtonMiniApp extends _InlineKeyboardButtonBase {
|
|
40
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* The mini app to launch.
|
|
59
|
+
* @discriminator
|
|
60
|
+
*/
|
|
41
61
|
miniApp: MiniAppInfo;
|
|
42
62
|
}
|
|
43
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* An inline keyboard button that, when pressed, logs the user into the specified URL.
|
|
65
|
+
* @unlisted
|
|
66
|
+
*/
|
|
44
67
|
export interface InlineKeyboardButtonLogin extends _InlineKeyboardButtonBase {
|
|
45
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* The URL to log into.
|
|
70
|
+
* @discriminator
|
|
71
|
+
*/
|
|
46
72
|
loginUrl: LoginUrl;
|
|
47
73
|
}
|
|
48
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* An inline keyboard button that, when pressed, switches to inline mode in a chat chosen by the user.
|
|
76
|
+
* @unlisted
|
|
77
|
+
*/
|
|
49
78
|
export interface InlineKeyboardButtonSwitchInline extends _InlineKeyboardButtonBase {
|
|
50
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* The query to type into the user's message box once switched to inline.
|
|
81
|
+
* @discriminator
|
|
82
|
+
*/
|
|
51
83
|
switchInlineQuery: string;
|
|
52
84
|
}
|
|
53
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* An inline keyboard button that, when pressed, switches to inline mode in the current chat.
|
|
87
|
+
* @unlisted
|
|
88
|
+
*/
|
|
54
89
|
export interface InlineKeyboardButtonSwitchInlineCurrent extends _InlineKeyboardButtonBase {
|
|
55
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* The query to type into the user's message box once switched to inline.
|
|
92
|
+
* @discriminator
|
|
93
|
+
*/
|
|
56
94
|
switchInlineQueryCurrentChat: string;
|
|
57
95
|
}
|
|
58
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* An inline keyboard button that, when pressed, switches to inline mode in a chat chosen by the user from a limited subset of chats.
|
|
98
|
+
* @unlisted
|
|
99
|
+
*/
|
|
59
100
|
export interface InlineKeyboardButtonSwitchInlineChosen extends _InlineKeyboardButtonBase {
|
|
60
101
|
/** @discriminator */
|
|
61
102
|
switchInlineQueryChosenChats: {
|
|
@@ -66,12 +107,18 @@ export interface InlineKeyboardButtonSwitchInlineChosen extends _InlineKeyboardB
|
|
|
66
107
|
allowChannels?: boolean;
|
|
67
108
|
};
|
|
68
109
|
}
|
|
69
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* An inline keyboard button that, when pressed, launches the bot's game.
|
|
112
|
+
* @unlisted
|
|
113
|
+
*/
|
|
70
114
|
export interface InlineKeyboardButtonGame extends _InlineKeyboardButtonBase {
|
|
71
115
|
/** @discriminator */
|
|
72
116
|
callbackGame: Record<never, never>;
|
|
73
117
|
}
|
|
74
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* An inline keyboard that, when pressed, initiates a payment.
|
|
120
|
+
* @unlisted
|
|
121
|
+
*/
|
|
75
122
|
export interface InlineKeyboardButtonPay extends _InlineKeyboardButtonBase {
|
|
76
123
|
/** @discriminator */
|
|
77
124
|
pay: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_inline_keyboard_button.d.ts","sourceRoot":"","sources":["../../src/types/2_inline_keyboard_button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAwB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEzE,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;CACd;AAED
|
|
1
|
+
{"version":3,"file":"2_inline_keyboard_button.d.ts","sourceRoot":"","sources":["../../src/types/2_inline_keyboard_button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAwB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEzE,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACxC,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,yBAAyB;IACxE;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA6B,SAAQ,yBAAyB;IAC7E;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,gBAAgB;AAChB,MAAM,WAAW,2BAA4B,SAAQ,yBAAyB;IAC5E;;;OAGG;IACH,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC1E;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAiC,SAAQ,yBAAyB;IACjF;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,uCAAwC,SAAQ,yBAAyB;IACxF;;;OAGG;IACH,4BAA4B,EAAE,MAAM,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,sCAAuC,SAAQ,yBAAyB;IACvF,qBAAqB;IACrB,4BAA4B,EAAE;QAC5B,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,qBAAqB;IACrB,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,yBAAyB;IACxE,qBAAqB;IACrB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,sCAAsC;AACtC,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,4BAA4B,GAC5B,2BAA2B,GAC3B,yBAAyB,GACzB,gCAAgC,GAChC,uCAAuC,GACvC,sCAAsC,GACtC,wBAAwB,GACxB,uBAAuB,CAAC;AAE5B,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,GAAG,CAAC,cAAc,GAAG,oBAAoB,CA8B/F;AAED,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAqClJ"}
|
package/esm/types/4_message.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { Invoice } from "./0_invoice.js";
|
|
|
26
26
|
import { LinkPreview } from "./0_link_preview.js";
|
|
27
27
|
import { Location } from "./0_location.js";
|
|
28
28
|
import { MessageEntity } from "./0_message_entity.js";
|
|
29
|
+
import { RefundedPayment } from "./0_refunded_payment.js";
|
|
29
30
|
import { Voice } from "./0_voice.js";
|
|
30
31
|
import { Animation } from "./1_animation.js";
|
|
31
32
|
import { Audio } from "./1_audio.js";
|
|
@@ -40,11 +41,11 @@ import { User } from "./1_user.js";
|
|
|
40
41
|
import { Venue } from "./1_venue.js";
|
|
41
42
|
import { VideoNote } from "./1_video_note.js";
|
|
42
43
|
import { Video } from "./1_video.js";
|
|
44
|
+
import { ForwardHeader } from "./2_forward_header.js";
|
|
43
45
|
import { Game } from "./2_game.js";
|
|
44
46
|
import { Poll } from "./2_poll.js";
|
|
45
|
-
import { ReplyMarkup } from "./3_reply_markup.js";
|
|
46
47
|
import { SuccessfulPayment } from "./2_successful_payment.js";
|
|
47
|
-
import {
|
|
48
|
+
import { ReplyMarkup } from "./3_reply_markup.js";
|
|
48
49
|
/**
|
|
49
50
|
* Properties shared between all message types.
|
|
50
51
|
* @unlisted
|
|
@@ -66,18 +67,8 @@ export interface _MessageBase {
|
|
|
66
67
|
chat: ChatP;
|
|
67
68
|
/** A link to the message. */
|
|
68
69
|
link?: string;
|
|
69
|
-
/**
|
|
70
|
-
forwardFrom?:
|
|
71
|
-
/** The original chat of the message. */
|
|
72
|
-
forwardFromChat?: ChatP;
|
|
73
|
-
/** The original identifier of the message. */
|
|
74
|
-
forwardId?: number;
|
|
75
|
-
/** The original signature of the message. */
|
|
76
|
-
forwardSignature?: string;
|
|
77
|
-
/** The name of the original sender of the message. */
|
|
78
|
-
forwardSenderName?: string;
|
|
79
|
-
/** The point in time in which the original message was sent. */
|
|
80
|
-
forwardDate?: Date;
|
|
70
|
+
/** Information on the original message. */
|
|
71
|
+
forwardFrom?: ForwardHeader;
|
|
81
72
|
/** Whether the message was sent in a topic thread. */
|
|
82
73
|
isTopicMessage: boolean;
|
|
83
74
|
/** Whether the message is an automatic forward. */
|
|
@@ -106,9 +97,13 @@ export interface _MessageBase {
|
|
|
106
97
|
forwards?: number;
|
|
107
98
|
/** The message's reply markup. */
|
|
108
99
|
replyMarkup?: ReplyMarkup;
|
|
100
|
+
/** The identifier of a business conection that the message was sent in. */
|
|
109
101
|
businessConnectionId?: string;
|
|
102
|
+
/** The number of the boosts made by the sender of the message. */
|
|
110
103
|
senderBoostCount?: number;
|
|
104
|
+
/** The identifier of the business connection in which the message was sent.*/
|
|
111
105
|
viaBusinessBot?: User;
|
|
106
|
+
/** The identifier of the message effect that has been attached to the message. */
|
|
112
107
|
effectId?: string;
|
|
113
108
|
}
|
|
114
109
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_message.d.ts","sourceRoot":"","sources":["../../src/types/4_message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAA6C,YAAY,EAAmB,MAAM,mBAAmB,CAAC;AAC7G,OAAO,EAAE,GAAG,EAAU,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAoB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAoB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAwB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAA0B,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAkB,KAAK,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAkB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,KAAK,EAAkB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAqB,QAAQ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B,EACvC,SAAS,UAAO,EAChB,QAAQ,CAAC,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,GAChE,OAAO,CAAC,OAAO,CAAC,CAyOlB"}
|
package/esm/types/4_message.js
CHANGED
|
@@ -28,6 +28,7 @@ import { constructInvoice } from "./0_invoice.js";
|
|
|
28
28
|
import { constructLinkPreview } from "./0_link_preview.js";
|
|
29
29
|
import { constructLocation } from "./0_location.js";
|
|
30
30
|
import { constructMessageEntity } from "./0_message_entity.js";
|
|
31
|
+
import { constructRefundedPayment } from "./0_refunded_payment.js";
|
|
31
32
|
import { constructVoice } from "./0_voice.js";
|
|
32
33
|
import { constructAnimation } from "./1_animation.js";
|
|
33
34
|
import { constructAudio } from "./1_audio.js";
|
|
@@ -42,11 +43,11 @@ import { constructUser } from "./1_user.js";
|
|
|
42
43
|
import { constructVenue } from "./1_venue.js";
|
|
43
44
|
import { constructVideoNote } from "./1_video_note.js";
|
|
44
45
|
import { constructVideo } from "./1_video.js";
|
|
46
|
+
import { constructForwardHeader } from "./2_forward_header.js";
|
|
45
47
|
import { constructGame } from "./2_game.js";
|
|
46
48
|
import { constructPoll } from "./2_poll.js";
|
|
47
|
-
import { constructReplyMarkup } from "./3_reply_markup.js";
|
|
48
49
|
import { constructSuccessfulPayment } from "./2_successful_payment.js";
|
|
49
|
-
import {
|
|
50
|
+
import { constructReplyMarkup } from "./3_reply_markup.js";
|
|
50
51
|
const L = getLogger("Message");
|
|
51
52
|
const keys = {
|
|
52
53
|
text: ["text"],
|
|
@@ -395,28 +396,7 @@ export async function constructMessage(message_, getEntity, getMessage, getStick
|
|
|
395
396
|
}
|
|
396
397
|
if (is("messageFwdHeader", message_.fwd_from)) {
|
|
397
398
|
message.isAutomaticForward = message_.fwd_from.saved_from_peer != undefined && message_.fwd_from.saved_from_msg_id != undefined;
|
|
398
|
-
message.
|
|
399
|
-
message.forwardId = message_.fwd_from.channel_post;
|
|
400
|
-
message.forwardSignature = message_.fwd_from.post_author;
|
|
401
|
-
message.forwardDate = fromUnixTimestamp(message_.fwd_from.date);
|
|
402
|
-
if (is("peerUser", message_.fwd_from.from_id)) {
|
|
403
|
-
const entity = await getEntity(message_.fwd_from.from_id);
|
|
404
|
-
if (entity) {
|
|
405
|
-
message.forwardFrom = constructUser(entity);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
else if (is("peerChat", message_.fwd_from.from_id)) {
|
|
409
|
-
const entity = await getEntity(message_.fwd_from.from_id);
|
|
410
|
-
if (entity) {
|
|
411
|
-
message.forwardFromChat = constructChatP(entity);
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
else if (is("peerChannel", message_.fwd_from.from_id)) {
|
|
415
|
-
const entity = await getEntity(message_.fwd_from.from_id);
|
|
416
|
-
if (entity) {
|
|
417
|
-
message.forwardFromChat = constructChatP(entity);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
399
|
+
message.forwardFrom = await constructForwardHeader(message_.fwd_from, getEntity);
|
|
420
400
|
}
|
|
421
401
|
if (message_.grouped_id != undefined) {
|
|
422
402
|
message.mediaGroupId = String(message_.grouped_id);
|
|
@@ -430,7 +410,7 @@ export async function constructMessage(message_, getEntity, getMessage, getStick
|
|
|
430
410
|
entities: message_.entities?.map(constructMessageEntity).filter((v) => !!v) ?? [],
|
|
431
411
|
};
|
|
432
412
|
if (message_.message && message_.media === undefined) {
|
|
433
|
-
return messageText;
|
|
413
|
+
return cleanObject(messageText);
|
|
434
414
|
}
|
|
435
415
|
const messageMedia = {
|
|
436
416
|
...message,
|
package/esm/types/6_update.d.ts
CHANGED
|
@@ -30,11 +30,11 @@ import { MessageReactionCount } from "./2_message_reaction_count.js";
|
|
|
30
30
|
import { MessageReactions } from "./2_message_reactions.js";
|
|
31
31
|
import { PreCheckoutQuery } from "./2_pre_checkout_query.js";
|
|
32
32
|
import { ChatMemberUpdated } from "./3_chat_member_updated.js";
|
|
33
|
+
import { JoinRequest } from "./3_join_request.js";
|
|
33
34
|
import { Story } from "./3_story.js";
|
|
34
35
|
import { Message } from "./4_message.js";
|
|
35
36
|
import { CallbackQuery } from "./5_callback_query.js";
|
|
36
37
|
import { ChatListItem } from "./5_chat_list_item.js";
|
|
37
|
-
import { JoinRequest } from "./3_join_request.js";
|
|
38
38
|
/**
|
|
39
39
|
* A client's connection state was changed.
|
|
40
40
|
*
|
|
@@ -56,7 +56,7 @@ export interface UpdateConnectionState {
|
|
|
56
56
|
* A client's authorization state was changed.
|
|
57
57
|
*
|
|
58
58
|
* ```
|
|
59
|
-
* client.on("authorizationState", (ctx) => {
|
|
59
|
+
* client.on("authorizationState", async (ctx) => {
|
|
60
60
|
* if (ctx.authorizationState.authorized) {
|
|
61
61
|
* const me = await ctx.client.getMe();
|
|
62
62
|
* console.log("The client is now authorized as", me.firstName);
|
|
@@ -265,6 +265,12 @@ export interface UpdateMyChatMember {
|
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
267
267
|
* A story was deleted.
|
|
268
|
+
*
|
|
269
|
+
* ```
|
|
270
|
+
* client.on("deletedStory", (ctx) => {
|
|
271
|
+
* console.log("The story", ctx.deletedStory, "was deleted");
|
|
272
|
+
* });
|
|
273
|
+
* ```
|
|
268
274
|
* @unlisted
|
|
269
275
|
*/
|
|
270
276
|
export interface UpdateDeletedStory {
|
|
@@ -273,6 +279,13 @@ export interface UpdateDeletedStory {
|
|
|
273
279
|
}
|
|
274
280
|
/**
|
|
275
281
|
* A story was posted.
|
|
282
|
+
*
|
|
283
|
+
* ```
|
|
284
|
+
* client.on("story", (ctx) => {
|
|
285
|
+
* console.log("title" in ctx.chat ? ctx.chat.title : ctx.chat.firstName, "posted a story");
|
|
286
|
+
* console.log(ctx.story);
|
|
287
|
+
* });
|
|
288
|
+
* ```
|
|
276
289
|
* @unlisted
|
|
277
290
|
*/
|
|
278
291
|
export interface UpdateNewStory {
|
|
@@ -281,6 +294,13 @@ export interface UpdateNewStory {
|
|
|
281
294
|
}
|
|
282
295
|
/**
|
|
283
296
|
* A business connection was added, modified, or removed.
|
|
297
|
+
*
|
|
298
|
+
* ```
|
|
299
|
+
* client.on("businessConnection", (ctx) => {
|
|
300
|
+
* console.log("Business connection with", ctx.from.id, ctx.businessConnection.isEnabled ? "created" : "lost");
|
|
301
|
+
* console.log(ctx.businessConnection);
|
|
302
|
+
* });
|
|
303
|
+
* ```
|
|
284
304
|
* @unlisted
|
|
285
305
|
*/
|
|
286
306
|
export interface UpdateBusinessConnection {
|
|
@@ -289,6 +309,13 @@ export interface UpdateBusinessConnection {
|
|
|
289
309
|
}
|
|
290
310
|
/**
|
|
291
311
|
* A video chat was started, scheduled, or ended.
|
|
312
|
+
*
|
|
313
|
+
* ```
|
|
314
|
+
* client.on("videoChat", (ctx) => {
|
|
315
|
+
* console.log("Video chat", ctx.videoChat.type);
|
|
316
|
+
* console.log(ctx.videoChat);
|
|
317
|
+
* });
|
|
318
|
+
* ```
|
|
292
319
|
* @unlisted
|
|
293
320
|
*/
|
|
294
321
|
export interface UpdateVideoChat {
|