@mtcute/core 0.31.0 → 0.32.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.
- package/client.cjs +12 -0
- package/client.js +12 -0
- package/highlevel/client.d.cts +79 -10
- package/highlevel/client.d.ts +79 -10
- package/highlevel/methods/chats/build-peers-index.cjs +45 -0
- package/highlevel/methods/chats/build-peers-index.d.cts +13 -0
- package/highlevel/methods/chats/build-peers-index.d.ts +13 -0
- package/highlevel/methods/chats/build-peers-index.js +40 -0
- package/highlevel/methods/ephemeral/delete-all-welcome-messages.cjs +17 -0
- package/highlevel/methods/ephemeral/delete-all-welcome-messages.d.cts +8 -0
- package/highlevel/methods/ephemeral/delete-all-welcome-messages.d.ts +8 -0
- package/highlevel/methods/ephemeral/delete-all-welcome-messages.js +12 -0
- package/highlevel/methods/ephemeral/delete-ephemeral-message.cjs +1 -1
- package/highlevel/methods/ephemeral/delete-ephemeral-message.d.cts +2 -2
- package/highlevel/methods/ephemeral/delete-ephemeral-message.d.ts +2 -2
- package/highlevel/methods/ephemeral/delete-ephemeral-message.js +1 -1
- package/highlevel/methods/ephemeral/delete-welcome-message.cjs +18 -0
- package/highlevel/methods/ephemeral/delete-welcome-message.d.cts +9 -0
- package/highlevel/methods/ephemeral/delete-welcome-message.d.ts +9 -0
- package/highlevel/methods/ephemeral/delete-welcome-message.js +13 -0
- package/highlevel/methods/ephemeral/edit-ephemeral-message.cjs +11 -3
- package/highlevel/methods/ephemeral/edit-ephemeral-message.d.cts +16 -2
- package/highlevel/methods/ephemeral/edit-ephemeral-message.d.ts +16 -2
- package/highlevel/methods/ephemeral/edit-ephemeral-message.js +11 -3
- package/highlevel/methods/ephemeral/get-welcome-messages.cjs +29 -0
- package/highlevel/methods/ephemeral/get-welcome-messages.d.cts +8 -0
- package/highlevel/methods/ephemeral/get-welcome-messages.d.ts +8 -0
- package/highlevel/methods/ephemeral/get-welcome-messages.js +24 -0
- package/highlevel/methods/ephemeral/send-ephemeral-message.cjs +13 -3
- package/highlevel/methods/ephemeral/send-ephemeral-message.d.cts +20 -2
- package/highlevel/methods/ephemeral/send-ephemeral-message.d.ts +20 -2
- package/highlevel/methods/ephemeral/send-ephemeral-message.js +13 -3
- package/highlevel/methods/files/download-iterable.cjs +3 -0
- package/highlevel/methods/files/download-iterable.js +3 -0
- package/highlevel/methods/files/normalize-input-media.cjs +25 -4
- package/highlevel/methods/files/normalize-input-media.js +25 -4
- package/highlevel/methods/forums/edit-forum-topic.cjs +1 -1
- package/highlevel/methods/forums/edit-forum-topic.js +1 -1
- package/highlevel/methods/forums/toggle-forum-topic-closed.cjs +1 -1
- package/highlevel/methods/forums/toggle-forum-topic-closed.js +1 -1
- package/highlevel/methods/forums/toggle-general-topic-hidden.cjs +1 -1
- package/highlevel/methods/forums/toggle-general-topic-hidden.js +1 -1
- package/highlevel/methods/gifts/buy-resale-gift.cjs +5 -2
- package/highlevel/methods/gifts/buy-resale-gift.d.cts +11 -1
- package/highlevel/methods/gifts/buy-resale-gift.d.ts +11 -1
- package/highlevel/methods/gifts/buy-resale-gift.js +5 -2
- package/highlevel/methods/messages/edit-message.cjs +7 -1
- package/highlevel/methods/messages/edit-message.d.cts +6 -2
- package/highlevel/methods/messages/edit-message.d.ts +6 -2
- package/highlevel/methods/messages/edit-message.js +7 -1
- package/highlevel/methods/messages/edit-message.test.d.cts +1 -0
- package/highlevel/methods/messages/edit-message.test.d.ts +1 -0
- package/highlevel/methods/messages/forward-messages.cjs +1 -0
- package/highlevel/methods/messages/forward-messages.d.cts +2 -0
- package/highlevel/methods/messages/forward-messages.d.ts +2 -0
- package/highlevel/methods/messages/forward-messages.js +1 -0
- package/highlevel/methods/messages/normalize-rich-message.cjs +3 -0
- package/highlevel/methods/messages/normalize-rich-message.js +3 -0
- package/highlevel/methods/messages/send-text.cjs +2 -33
- package/highlevel/methods/messages/send-text.js +2 -33
- package/highlevel/methods/messages/send-typing.d.cts +3 -3
- package/highlevel/methods/messages/send-typing.d.ts +3 -3
- package/highlevel/methods/messages/set-typing.cjs +1 -1
- package/highlevel/methods/messages/set-typing.d.cts +2 -2
- package/highlevel/methods/messages/set-typing.d.ts +2 -2
- package/highlevel/methods/messages/set-typing.js +1 -1
- package/highlevel/methods.d.cts +3 -0
- package/highlevel/methods.d.ts +3 -0
- package/highlevel/types/bots/keyboards/builder.cjs +5 -5
- package/highlevel/types/bots/keyboards/builder.d.cts +8 -9
- package/highlevel/types/bots/keyboards/builder.d.ts +8 -9
- package/highlevel/types/bots/keyboards/builder.js +5 -5
- package/highlevel/types/bots/keyboards/factories.cjs +51 -103
- package/highlevel/types/bots/keyboards/factories.d.cts +58 -89
- package/highlevel/types/bots/keyboards/factories.d.ts +58 -89
- package/highlevel/types/bots/keyboards/factories.js +51 -103
- package/highlevel/types/bots/keyboards/index.d.cts +3 -3
- package/highlevel/types/bots/keyboards/index.d.ts +3 -3
- package/highlevel/types/bots/keyboards/normalize.cjs +131 -0
- package/highlevel/types/bots/keyboards/normalize.d.cts +10 -0
- package/highlevel/types/bots/keyboards/normalize.d.ts +10 -0
- package/highlevel/types/bots/keyboards/normalize.js +126 -0
- package/highlevel/types/bots/keyboards/types.d.cts +160 -4
- package/highlevel/types/bots/keyboards/types.d.ts +160 -4
- package/highlevel/types/messages/dialog.cjs +8 -1
- package/highlevel/types/messages/dialog.d.cts +3 -0
- package/highlevel/types/messages/dialog.d.ts +3 -0
- package/highlevel/types/messages/dialog.js +8 -1
- package/highlevel/types/messages/dialog.test.d.cts +1 -0
- package/highlevel/types/messages/dialog.test.d.ts +1 -0
- package/highlevel/types/messages/ephemeral-message.cjs +35 -3
- package/highlevel/types/messages/ephemeral-message.d.cts +22 -2
- package/highlevel/types/messages/ephemeral-message.d.ts +22 -2
- package/highlevel/types/messages/ephemeral-message.js +35 -3
- package/highlevel/types/messages/message-action.cjs +8 -1
- package/highlevel/types/messages/message-action.d.cts +11 -1
- package/highlevel/types/messages/message-action.d.ts +11 -1
- package/highlevel/types/messages/message-action.js +8 -1
- package/highlevel/types/messages/message.cjs +7 -2
- package/highlevel/types/messages/message.d.cts +2 -2
- package/highlevel/types/messages/message.d.ts +2 -2
- package/highlevel/types/messages/message.js +8 -3
- package/highlevel/types/messages/rich/inner.cjs +37 -0
- package/highlevel/types/messages/rich/inner.d.cts +19 -0
- package/highlevel/types/messages/rich/inner.d.ts +19 -0
- package/highlevel/types/messages/rich/inner.js +37 -0
- package/highlevel/types/peers/full-chat.cjs +4 -0
- package/highlevel/types/peers/full-chat.d.cts +2 -0
- package/highlevel/types/peers/full-chat.d.ts +2 -0
- package/highlevel/types/peers/full-chat.js +4 -0
- package/highlevel/types/peers/typing-status.d.cts +4 -1
- package/highlevel/types/peers/typing-status.d.ts +4 -1
- package/highlevel/types/updates/ephemeral-callback-query.cjs +10 -2
- package/highlevel/types/updates/ephemeral-callback-query.d.cts +8 -2
- package/highlevel/types/updates/ephemeral-callback-query.d.ts +8 -2
- package/highlevel/types/updates/ephemeral-callback-query.js +10 -2
- package/highlevel/types/updates/user-typing-update.cjs +18 -0
- package/highlevel/types/updates/user-typing-update.d.cts +9 -0
- package/highlevel/types/updates/user-typing-update.d.ts +9 -0
- package/highlevel/types/updates/user-typing-update.js +18 -0
- package/highlevel/updates/manager.cjs +40 -28
- package/highlevel/updates/manager.js +40 -28
- package/highlevel/utils/walk-page-blocks.cjs +5 -0
- package/highlevel/utils/walk-page-blocks.js +5 -0
- package/methods.cjs +6 -0
- package/methods.js +6 -0
- package/network/mtproto-session.cjs +9 -2
- package/network/mtproto-session.d.cts +3 -1
- package/network/mtproto-session.d.ts +3 -1
- package/network/mtproto-session.js +9 -2
- package/network/network-manager.cjs +1 -1
- package/network/network-manager.js +1 -1
- package/network/session-connection.cjs +12 -6
- package/network/session-connection.js +12 -6
- package/network/session-connection.test.d.cts +1 -0
- package/network/session-connection.test.d.ts +1 -0
- package/package.json +3 -3
- package/tl/api-schema.json +1 -1
- package/tl/binary/reader.cjs +136 -93
- package/tl/binary/reader.js +136 -93
- package/tl/binary/writer.cjs +318 -207
- package/tl/binary/writer.js +318 -207
- package/tl/compat/reader.cjs +82 -0
- package/tl/compat/reader.js +82 -0
- package/tl/index.d.cts +377 -718
- package/tl/index.d.ts +377 -718
- package/tl/inner-tl.cjs +23 -7
- package/tl/inner-tl.js +23 -7
- package/tl/rpc-error.test.d.cts +1 -0
- package/tl/rpc-error.test.d.ts +1 -0
- package/utils/binary/compat.cjs +175 -29
- package/utils/binary/compat.js +175 -29
- package/utils/links/bots.cjs +9 -4
- package/utils/links/bots.js +9 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { tl } from '../../../../tl/index.js';
|
|
2
|
+
import { BotKeyboardButton, BotKeyboardButtonStyle, InputInlineKeyboardButton, InputReplyKeyboardButton } from './types.js';
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare function _toRichButtonStyle(style?: BotKeyboardButtonStyle): tl.RawRichButtonStyle | undefined;
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare function _toInlineButtonType(btn: BotKeyboardButton): tl.TypeInlineButtonType;
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare function _toInlineButton(btn: InputInlineKeyboardButton): tl.TypeKeyboardInlineButton;
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare function _toReplyButton(btn: InputReplyKeyboardButton): tl.TypeKeyboardButton;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { MtArgumentError } from "../../../../types/errors.js";
|
|
2
|
+
function toKeyboardStyle(style) {
|
|
3
|
+
if (!style) return void 0;
|
|
4
|
+
return {
|
|
5
|
+
_: "keyboardButtonStyle",
|
|
6
|
+
bgPrimary: style.bgPrimary,
|
|
7
|
+
bgDanger: style.bgDanger,
|
|
8
|
+
bgSuccess: style.bgSuccess,
|
|
9
|
+
icon: style.icon
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function _toRichButtonStyle(style) {
|
|
13
|
+
if (!style) return void 0;
|
|
14
|
+
return {
|
|
15
|
+
_: "richButtonStyle",
|
|
16
|
+
bgPrimary: style.bgPrimary,
|
|
17
|
+
bgDanger: style.bgDanger,
|
|
18
|
+
bgSuccess: style.bgSuccess,
|
|
19
|
+
link: style.link
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function _toInlineButtonType(btn) {
|
|
23
|
+
switch (btn.type) {
|
|
24
|
+
case "url":
|
|
25
|
+
return { _: "inlineButtonTypeUrl", url: btn.url };
|
|
26
|
+
case "webview":
|
|
27
|
+
return { _: "inlineButtonTypeWebView", url: btn.url };
|
|
28
|
+
case "callback":
|
|
29
|
+
return { _: "inlineButtonTypeCallback", data: btn.data, requiresPassword: btn.requiresPassword };
|
|
30
|
+
case "switch_inline":
|
|
31
|
+
return {
|
|
32
|
+
_: "inlineButtonTypeSwitchInline",
|
|
33
|
+
samePeer: btn.currentChat,
|
|
34
|
+
query: btn.query ?? "",
|
|
35
|
+
peerTypes: btn.peerTypes
|
|
36
|
+
};
|
|
37
|
+
case "game":
|
|
38
|
+
return { _: "inlineButtonTypeGame" };
|
|
39
|
+
case "pay":
|
|
40
|
+
return { _: "inlineButtonTypeBuy" };
|
|
41
|
+
case "url_auth":
|
|
42
|
+
return {
|
|
43
|
+
_: "inputInlineButtonTypeUrlAuth",
|
|
44
|
+
url: btn.url,
|
|
45
|
+
fwdText: btn.fwdText,
|
|
46
|
+
requestWriteAccess: btn.requestWriteAccess,
|
|
47
|
+
bot: btn.bot ?? { _: "inputUserSelf" }
|
|
48
|
+
};
|
|
49
|
+
case "user_profile":
|
|
50
|
+
return { _: "inputInlineButtonTypeUserProfile", userId: btn.user };
|
|
51
|
+
case "copy":
|
|
52
|
+
return { _: "inlineButtonTypeCopy", copyText: btn.copyText ?? btn.text };
|
|
53
|
+
case "disabled":
|
|
54
|
+
return { _: "inlineButtonTypeDisabled" };
|
|
55
|
+
default:
|
|
56
|
+
throw new MtArgumentError(`"${btn.type}" buttons can only be used in reply keyboards`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function toReplyButtonType(btn) {
|
|
60
|
+
switch (btn.type) {
|
|
61
|
+
case "text":
|
|
62
|
+
return { _: "buttonTypeDefault" };
|
|
63
|
+
case "request_contact":
|
|
64
|
+
return { _: "buttonTypeRequestPhone" };
|
|
65
|
+
case "request_geo":
|
|
66
|
+
return { _: "buttonTypeRequestGeoLocation" };
|
|
67
|
+
case "request_poll":
|
|
68
|
+
return { _: "buttonTypeRequestPoll", quiz: btn.quiz };
|
|
69
|
+
case "webview":
|
|
70
|
+
return { _: "buttonTypeSimpleWebView", url: btn.url };
|
|
71
|
+
case "request_peer":
|
|
72
|
+
if (btn.nameRequested || btn.usernameRequested || btn.photoRequested) {
|
|
73
|
+
return {
|
|
74
|
+
_: "inputButtonTypeRequestPeer",
|
|
75
|
+
nameRequested: btn.nameRequested,
|
|
76
|
+
usernameRequested: btn.usernameRequested,
|
|
77
|
+
photoRequested: btn.photoRequested,
|
|
78
|
+
buttonId: btn.buttonId,
|
|
79
|
+
peerType: btn.peerType,
|
|
80
|
+
maxQuantity: btn.count ?? 1
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
_: "buttonTypeRequestPeer",
|
|
85
|
+
buttonId: btn.buttonId,
|
|
86
|
+
peerType: btn.peerType,
|
|
87
|
+
maxQuantity: btn.count ?? 1
|
|
88
|
+
};
|
|
89
|
+
default:
|
|
90
|
+
throw new MtArgumentError(`"${btn.type}" buttons can only be used in inline keyboards`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function _toInlineButton(btn) {
|
|
94
|
+
if ("_" in btn) {
|
|
95
|
+
if (btn._ !== "keyboardInlineButton") {
|
|
96
|
+
throw new MtArgumentError("reply keyboard buttons cannot be used in inline keyboards");
|
|
97
|
+
}
|
|
98
|
+
return btn;
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
_: "keyboardInlineButton",
|
|
102
|
+
text: btn.text,
|
|
103
|
+
type: _toInlineButtonType(btn),
|
|
104
|
+
style: toKeyboardStyle(btn.style)
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function _toReplyButton(btn) {
|
|
108
|
+
if ("_" in btn) {
|
|
109
|
+
if (btn._ !== "keyboardButton") {
|
|
110
|
+
throw new MtArgumentError("inline keyboard buttons cannot be used in reply keyboards");
|
|
111
|
+
}
|
|
112
|
+
return btn;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
_: "keyboardButton",
|
|
116
|
+
text: btn.text,
|
|
117
|
+
type: toReplyButtonType(btn),
|
|
118
|
+
style: toKeyboardStyle(btn.style)
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
_toInlineButton,
|
|
123
|
+
_toInlineButtonType,
|
|
124
|
+
_toReplyButton,
|
|
125
|
+
_toRichButtonStyle
|
|
126
|
+
};
|
|
@@ -1,13 +1,166 @@
|
|
|
1
1
|
import { tl } from '../../../../tl/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Style of a bot keyboard button.
|
|
4
|
+
*
|
|
5
|
+
* Note that not every field is supported everywhere: {@link icon} is only
|
|
6
|
+
* used in keyboards, and {@link link} is only used in rich messages.
|
|
7
|
+
* Unsupported fields are silently dropped.
|
|
8
|
+
*/
|
|
9
|
+
export interface BotKeyboardButtonStyle {
|
|
10
|
+
/** Render the button with the primary background color */
|
|
11
|
+
bgPrimary?: boolean;
|
|
12
|
+
/** Render the button with the "danger" background color */
|
|
13
|
+
bgDanger?: boolean;
|
|
14
|
+
/** Render the button with the "success" background color */
|
|
15
|
+
bgSuccess?: boolean;
|
|
16
|
+
/** Custom emoji to be shown on the button (keyboards only) */
|
|
17
|
+
icon?: tl.Long;
|
|
18
|
+
/** Render the button as a link (rich messages only) */
|
|
19
|
+
link?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface BotKeyboardButtonBase {
|
|
22
|
+
/** Text of the button */
|
|
23
|
+
text: string;
|
|
24
|
+
/** Style of the button */
|
|
25
|
+
style?: BotKeyboardButtonStyle;
|
|
26
|
+
}
|
|
27
|
+
/** A text-only button (reply keyboards only) */
|
|
28
|
+
export interface TextButton extends BotKeyboardButtonBase {
|
|
29
|
+
readonly type: 'text';
|
|
30
|
+
}
|
|
31
|
+
/** A button requesting the user's phone number (reply keyboards only) */
|
|
32
|
+
export interface RequestContactButton extends BotKeyboardButtonBase {
|
|
33
|
+
readonly type: 'request_contact';
|
|
34
|
+
}
|
|
35
|
+
/** A button requesting the user's geolocation (reply keyboards only) */
|
|
36
|
+
export interface RequestGeoButton extends BotKeyboardButtonBase {
|
|
37
|
+
readonly type: 'request_geo';
|
|
38
|
+
}
|
|
39
|
+
/** A button requesting the user to create a poll (reply keyboards only) */
|
|
40
|
+
export interface RequestPollButton extends BotKeyboardButtonBase {
|
|
41
|
+
readonly type: 'request_poll';
|
|
42
|
+
/** If set, only quiz polls can be sent */
|
|
43
|
+
quiz?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** A button requesting the user to choose a peer (reply keyboards only) */
|
|
46
|
+
export interface RequestPeerButton extends BotKeyboardButtonBase {
|
|
47
|
+
readonly type: 'request_peer';
|
|
48
|
+
/** ID of the button, later passed to the service message */
|
|
49
|
+
buttonId: number;
|
|
50
|
+
/** Peer type, along with filters */
|
|
51
|
+
peerType: tl.TypeRequestPeerType;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum number of peers to be selected
|
|
54
|
+
*
|
|
55
|
+
* @default 1
|
|
56
|
+
*/
|
|
57
|
+
count?: number;
|
|
58
|
+
/** Whether to request the name of the peer */
|
|
59
|
+
nameRequested?: boolean;
|
|
60
|
+
/** Whether to request the username of the peer */
|
|
61
|
+
usernameRequested?: boolean;
|
|
62
|
+
/** Whether to request the photo of the peer */
|
|
63
|
+
photoRequested?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** A button opening a webview. Usable in both inline and reply keyboards */
|
|
66
|
+
export interface WebViewButton extends BotKeyboardButtonBase {
|
|
67
|
+
readonly type: 'webview';
|
|
68
|
+
/** URL of the webview */
|
|
69
|
+
url: string;
|
|
70
|
+
}
|
|
71
|
+
/** A button opening a link */
|
|
72
|
+
export interface UrlButton extends BotKeyboardButtonBase {
|
|
73
|
+
readonly type: 'url';
|
|
74
|
+
/** URL to open */
|
|
75
|
+
url: string;
|
|
76
|
+
}
|
|
77
|
+
/** A button sending a callback query to the bot */
|
|
78
|
+
export interface CallbackButton extends BotKeyboardButtonBase {
|
|
79
|
+
readonly type: 'callback';
|
|
80
|
+
/** Callback data (1-64 bytes) */
|
|
81
|
+
data: Uint8Array;
|
|
82
|
+
/** Whether the user should verify their identity by entering their 2FA password */
|
|
83
|
+
requiresPassword?: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** A button prompting the user to switch to inline mode */
|
|
86
|
+
export interface SwitchInlineButton extends BotKeyboardButtonBase {
|
|
87
|
+
readonly type: 'switch_inline';
|
|
88
|
+
/** Inline query (can be empty) */
|
|
89
|
+
query?: string;
|
|
90
|
+
/** Whether to insert the query in the current chat instead of prompting for one */
|
|
91
|
+
currentChat?: boolean;
|
|
92
|
+
/** Types of the peers that can be chosen by the user */
|
|
93
|
+
peerTypes?: tl.TypeInlineQueryPeerType[];
|
|
94
|
+
}
|
|
95
|
+
/** A button starting a game. Must be the first button in the first row */
|
|
96
|
+
export interface GameButton extends BotKeyboardButtonBase {
|
|
97
|
+
readonly type: 'game';
|
|
98
|
+
}
|
|
99
|
+
/** A button paying for a product. Must be the first button in the first row */
|
|
100
|
+
export interface PayButton extends BotKeyboardButtonBase {
|
|
101
|
+
readonly type: 'pay';
|
|
102
|
+
}
|
|
103
|
+
/** A button authorizing the user on a website */
|
|
104
|
+
export interface UrlAuthButton extends BotKeyboardButtonBase {
|
|
105
|
+
readonly type: 'url_auth';
|
|
106
|
+
/** Authorization URL */
|
|
107
|
+
url: string;
|
|
108
|
+
/** Button label when forwarded */
|
|
109
|
+
fwdText?: string;
|
|
110
|
+
/** Whether to request the permission for the bot to send messages to the user */
|
|
111
|
+
requestWriteAccess?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Bot which will be used for user authorization.
|
|
114
|
+
*
|
|
115
|
+
* @default current bot
|
|
116
|
+
*/
|
|
117
|
+
bot?: tl.TypeInputUser;
|
|
118
|
+
}
|
|
119
|
+
/** A button opening a user's profile */
|
|
120
|
+
export interface UserProfileButton extends BotKeyboardButtonBase {
|
|
121
|
+
readonly type: 'user_profile';
|
|
122
|
+
/** User whose profile should be opened */
|
|
123
|
+
user: tl.TypeInputUser;
|
|
124
|
+
}
|
|
125
|
+
/** A button copying text to the user's clipboard */
|
|
126
|
+
export interface CopyButton extends BotKeyboardButtonBase {
|
|
127
|
+
readonly type: 'copy';
|
|
128
|
+
/** Text to be copied (defaults to the button text) */
|
|
129
|
+
copyText?: string;
|
|
130
|
+
}
|
|
131
|
+
/** A button that does nothing when pressed */
|
|
132
|
+
export interface DisabledButton extends BotKeyboardButtonBase {
|
|
133
|
+
readonly type: 'disabled';
|
|
134
|
+
}
|
|
135
|
+
/** A button usable in reply keyboards */
|
|
136
|
+
export type ReplyBotKeyboardButton = TextButton | RequestContactButton | RequestGeoButton | RequestPollButton | RequestPeerButton | WebViewButton;
|
|
137
|
+
/** A button usable in inline keyboards (and in rich messages) */
|
|
138
|
+
export type InlineBotKeyboardButton = WebViewButton | UrlButton | CallbackButton | SwitchInlineButton | GameButton | PayButton | UrlAuthButton | UserProfileButton | CopyButton | DisabledButton;
|
|
139
|
+
/** A bot keyboard button */
|
|
140
|
+
export type BotKeyboardButton = ReplyBotKeyboardButton | InlineBotKeyboardButton;
|
|
141
|
+
/**
|
|
142
|
+
* A button accepted by the reply keyboard factories.
|
|
143
|
+
*
|
|
144
|
+
* Raw TL objects are passed through as-is.
|
|
145
|
+
*/
|
|
146
|
+
export type InputReplyKeyboardButton = ReplyBotKeyboardButton | tl.TypeKeyboardButton;
|
|
147
|
+
/**
|
|
148
|
+
* A button accepted by the inline keyboard and rich message factories.
|
|
149
|
+
*
|
|
150
|
+
* Raw TL objects are passed through as-is.
|
|
151
|
+
*/
|
|
152
|
+
export type InputInlineKeyboardButton = InlineBotKeyboardButton | tl.TypeKeyboardInlineButton;
|
|
153
|
+
/** A button accepted by any of the keyboard factories */
|
|
154
|
+
export type InputBotKeyboardButton = InputReplyKeyboardButton | InputInlineKeyboardButton;
|
|
2
155
|
/**
|
|
3
156
|
* Reply keyboard markup
|
|
4
157
|
*/
|
|
5
|
-
export interface ReplyKeyboardMarkup extends Omit<tl.RawReplyKeyboardMarkup, '_' | 'rows'> {
|
|
158
|
+
export interface ReplyKeyboardMarkup<Button = InputReplyKeyboardButton> extends Omit<tl.RawReplyKeyboardMarkup, '_' | 'rows'> {
|
|
6
159
|
readonly type: 'reply';
|
|
7
160
|
/**
|
|
8
161
|
* Two-dimensional array of buttons
|
|
9
162
|
*/
|
|
10
|
-
readonly buttons:
|
|
163
|
+
readonly buttons: Button[][];
|
|
11
164
|
}
|
|
12
165
|
/**
|
|
13
166
|
* Hide previously sent bot keyboard
|
|
@@ -24,11 +177,14 @@ export interface ReplyKeyboardForceReply extends Omit<tl.RawReplyKeyboardForceRe
|
|
|
24
177
|
/**
|
|
25
178
|
* Inline keyboard markup
|
|
26
179
|
*/
|
|
27
|
-
export interface InlineKeyboardMarkup {
|
|
180
|
+
export interface InlineKeyboardMarkup<Button = InputInlineKeyboardButton> extends Omit<tl.RawReplyInlineMarkup, '_' | 'rows'> {
|
|
28
181
|
readonly type: 'inline';
|
|
29
182
|
/**
|
|
30
183
|
* Two-dimensional array of buttons
|
|
31
184
|
*/
|
|
32
|
-
readonly buttons:
|
|
185
|
+
readonly buttons: Button[][];
|
|
33
186
|
}
|
|
34
187
|
export type ReplyMarkup = ReplyKeyboardMarkup | ReplyKeyboardHide | ReplyKeyboardForceReply | InlineKeyboardMarkup | tl.TypeReplyMarkup;
|
|
188
|
+
/** Reply markup as parsed from an existing message */
|
|
189
|
+
export type ParsedReplyMarkup = ReplyKeyboardMarkup<tl.TypeKeyboardButton> | ReplyKeyboardHide | ReplyKeyboardForceReply | InlineKeyboardMarkup<tl.TypeKeyboardInlineButton>;
|
|
190
|
+
export {};
|
|
@@ -1,13 +1,166 @@
|
|
|
1
1
|
import { tl } from '../../../../tl/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Style of a bot keyboard button.
|
|
4
|
+
*
|
|
5
|
+
* Note that not every field is supported everywhere: {@link icon} is only
|
|
6
|
+
* used in keyboards, and {@link link} is only used in rich messages.
|
|
7
|
+
* Unsupported fields are silently dropped.
|
|
8
|
+
*/
|
|
9
|
+
export interface BotKeyboardButtonStyle {
|
|
10
|
+
/** Render the button with the primary background color */
|
|
11
|
+
bgPrimary?: boolean;
|
|
12
|
+
/** Render the button with the "danger" background color */
|
|
13
|
+
bgDanger?: boolean;
|
|
14
|
+
/** Render the button with the "success" background color */
|
|
15
|
+
bgSuccess?: boolean;
|
|
16
|
+
/** Custom emoji to be shown on the button (keyboards only) */
|
|
17
|
+
icon?: tl.Long;
|
|
18
|
+
/** Render the button as a link (rich messages only) */
|
|
19
|
+
link?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface BotKeyboardButtonBase {
|
|
22
|
+
/** Text of the button */
|
|
23
|
+
text: string;
|
|
24
|
+
/** Style of the button */
|
|
25
|
+
style?: BotKeyboardButtonStyle;
|
|
26
|
+
}
|
|
27
|
+
/** A text-only button (reply keyboards only) */
|
|
28
|
+
export interface TextButton extends BotKeyboardButtonBase {
|
|
29
|
+
readonly type: 'text';
|
|
30
|
+
}
|
|
31
|
+
/** A button requesting the user's phone number (reply keyboards only) */
|
|
32
|
+
export interface RequestContactButton extends BotKeyboardButtonBase {
|
|
33
|
+
readonly type: 'request_contact';
|
|
34
|
+
}
|
|
35
|
+
/** A button requesting the user's geolocation (reply keyboards only) */
|
|
36
|
+
export interface RequestGeoButton extends BotKeyboardButtonBase {
|
|
37
|
+
readonly type: 'request_geo';
|
|
38
|
+
}
|
|
39
|
+
/** A button requesting the user to create a poll (reply keyboards only) */
|
|
40
|
+
export interface RequestPollButton extends BotKeyboardButtonBase {
|
|
41
|
+
readonly type: 'request_poll';
|
|
42
|
+
/** If set, only quiz polls can be sent */
|
|
43
|
+
quiz?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** A button requesting the user to choose a peer (reply keyboards only) */
|
|
46
|
+
export interface RequestPeerButton extends BotKeyboardButtonBase {
|
|
47
|
+
readonly type: 'request_peer';
|
|
48
|
+
/** ID of the button, later passed to the service message */
|
|
49
|
+
buttonId: number;
|
|
50
|
+
/** Peer type, along with filters */
|
|
51
|
+
peerType: tl.TypeRequestPeerType;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum number of peers to be selected
|
|
54
|
+
*
|
|
55
|
+
* @default 1
|
|
56
|
+
*/
|
|
57
|
+
count?: number;
|
|
58
|
+
/** Whether to request the name of the peer */
|
|
59
|
+
nameRequested?: boolean;
|
|
60
|
+
/** Whether to request the username of the peer */
|
|
61
|
+
usernameRequested?: boolean;
|
|
62
|
+
/** Whether to request the photo of the peer */
|
|
63
|
+
photoRequested?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** A button opening a webview. Usable in both inline and reply keyboards */
|
|
66
|
+
export interface WebViewButton extends BotKeyboardButtonBase {
|
|
67
|
+
readonly type: 'webview';
|
|
68
|
+
/** URL of the webview */
|
|
69
|
+
url: string;
|
|
70
|
+
}
|
|
71
|
+
/** A button opening a link */
|
|
72
|
+
export interface UrlButton extends BotKeyboardButtonBase {
|
|
73
|
+
readonly type: 'url';
|
|
74
|
+
/** URL to open */
|
|
75
|
+
url: string;
|
|
76
|
+
}
|
|
77
|
+
/** A button sending a callback query to the bot */
|
|
78
|
+
export interface CallbackButton extends BotKeyboardButtonBase {
|
|
79
|
+
readonly type: 'callback';
|
|
80
|
+
/** Callback data (1-64 bytes) */
|
|
81
|
+
data: Uint8Array;
|
|
82
|
+
/** Whether the user should verify their identity by entering their 2FA password */
|
|
83
|
+
requiresPassword?: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** A button prompting the user to switch to inline mode */
|
|
86
|
+
export interface SwitchInlineButton extends BotKeyboardButtonBase {
|
|
87
|
+
readonly type: 'switch_inline';
|
|
88
|
+
/** Inline query (can be empty) */
|
|
89
|
+
query?: string;
|
|
90
|
+
/** Whether to insert the query in the current chat instead of prompting for one */
|
|
91
|
+
currentChat?: boolean;
|
|
92
|
+
/** Types of the peers that can be chosen by the user */
|
|
93
|
+
peerTypes?: tl.TypeInlineQueryPeerType[];
|
|
94
|
+
}
|
|
95
|
+
/** A button starting a game. Must be the first button in the first row */
|
|
96
|
+
export interface GameButton extends BotKeyboardButtonBase {
|
|
97
|
+
readonly type: 'game';
|
|
98
|
+
}
|
|
99
|
+
/** A button paying for a product. Must be the first button in the first row */
|
|
100
|
+
export interface PayButton extends BotKeyboardButtonBase {
|
|
101
|
+
readonly type: 'pay';
|
|
102
|
+
}
|
|
103
|
+
/** A button authorizing the user on a website */
|
|
104
|
+
export interface UrlAuthButton extends BotKeyboardButtonBase {
|
|
105
|
+
readonly type: 'url_auth';
|
|
106
|
+
/** Authorization URL */
|
|
107
|
+
url: string;
|
|
108
|
+
/** Button label when forwarded */
|
|
109
|
+
fwdText?: string;
|
|
110
|
+
/** Whether to request the permission for the bot to send messages to the user */
|
|
111
|
+
requestWriteAccess?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Bot which will be used for user authorization.
|
|
114
|
+
*
|
|
115
|
+
* @default current bot
|
|
116
|
+
*/
|
|
117
|
+
bot?: tl.TypeInputUser;
|
|
118
|
+
}
|
|
119
|
+
/** A button opening a user's profile */
|
|
120
|
+
export interface UserProfileButton extends BotKeyboardButtonBase {
|
|
121
|
+
readonly type: 'user_profile';
|
|
122
|
+
/** User whose profile should be opened */
|
|
123
|
+
user: tl.TypeInputUser;
|
|
124
|
+
}
|
|
125
|
+
/** A button copying text to the user's clipboard */
|
|
126
|
+
export interface CopyButton extends BotKeyboardButtonBase {
|
|
127
|
+
readonly type: 'copy';
|
|
128
|
+
/** Text to be copied (defaults to the button text) */
|
|
129
|
+
copyText?: string;
|
|
130
|
+
}
|
|
131
|
+
/** A button that does nothing when pressed */
|
|
132
|
+
export interface DisabledButton extends BotKeyboardButtonBase {
|
|
133
|
+
readonly type: 'disabled';
|
|
134
|
+
}
|
|
135
|
+
/** A button usable in reply keyboards */
|
|
136
|
+
export type ReplyBotKeyboardButton = TextButton | RequestContactButton | RequestGeoButton | RequestPollButton | RequestPeerButton | WebViewButton;
|
|
137
|
+
/** A button usable in inline keyboards (and in rich messages) */
|
|
138
|
+
export type InlineBotKeyboardButton = WebViewButton | UrlButton | CallbackButton | SwitchInlineButton | GameButton | PayButton | UrlAuthButton | UserProfileButton | CopyButton | DisabledButton;
|
|
139
|
+
/** A bot keyboard button */
|
|
140
|
+
export type BotKeyboardButton = ReplyBotKeyboardButton | InlineBotKeyboardButton;
|
|
141
|
+
/**
|
|
142
|
+
* A button accepted by the reply keyboard factories.
|
|
143
|
+
*
|
|
144
|
+
* Raw TL objects are passed through as-is.
|
|
145
|
+
*/
|
|
146
|
+
export type InputReplyKeyboardButton = ReplyBotKeyboardButton | tl.TypeKeyboardButton;
|
|
147
|
+
/**
|
|
148
|
+
* A button accepted by the inline keyboard and rich message factories.
|
|
149
|
+
*
|
|
150
|
+
* Raw TL objects are passed through as-is.
|
|
151
|
+
*/
|
|
152
|
+
export type InputInlineKeyboardButton = InlineBotKeyboardButton | tl.TypeKeyboardInlineButton;
|
|
153
|
+
/** A button accepted by any of the keyboard factories */
|
|
154
|
+
export type InputBotKeyboardButton = InputReplyKeyboardButton | InputInlineKeyboardButton;
|
|
2
155
|
/**
|
|
3
156
|
* Reply keyboard markup
|
|
4
157
|
*/
|
|
5
|
-
export interface ReplyKeyboardMarkup extends Omit<tl.RawReplyKeyboardMarkup, '_' | 'rows'> {
|
|
158
|
+
export interface ReplyKeyboardMarkup<Button = InputReplyKeyboardButton> extends Omit<tl.RawReplyKeyboardMarkup, '_' | 'rows'> {
|
|
6
159
|
readonly type: 'reply';
|
|
7
160
|
/**
|
|
8
161
|
* Two-dimensional array of buttons
|
|
9
162
|
*/
|
|
10
|
-
readonly buttons:
|
|
163
|
+
readonly buttons: Button[][];
|
|
11
164
|
}
|
|
12
165
|
/**
|
|
13
166
|
* Hide previously sent bot keyboard
|
|
@@ -24,11 +177,14 @@ export interface ReplyKeyboardForceReply extends Omit<tl.RawReplyKeyboardForceRe
|
|
|
24
177
|
/**
|
|
25
178
|
* Inline keyboard markup
|
|
26
179
|
*/
|
|
27
|
-
export interface InlineKeyboardMarkup {
|
|
180
|
+
export interface InlineKeyboardMarkup<Button = InputInlineKeyboardButton> extends Omit<tl.RawReplyInlineMarkup, '_' | 'rows'> {
|
|
28
181
|
readonly type: 'inline';
|
|
29
182
|
/**
|
|
30
183
|
* Two-dimensional array of buttons
|
|
31
184
|
*/
|
|
32
|
-
readonly buttons:
|
|
185
|
+
readonly buttons: Button[][];
|
|
33
186
|
}
|
|
34
187
|
export type ReplyMarkup = ReplyKeyboardMarkup | ReplyKeyboardHide | ReplyKeyboardForceReply | InlineKeyboardMarkup | tl.TypeReplyMarkup;
|
|
188
|
+
/** Reply markup as parsed from an existing message */
|
|
189
|
+
export type ParsedReplyMarkup = ReplyKeyboardMarkup<tl.TypeKeyboardButton> | ReplyKeyboardHide | ReplyKeyboardForceReply | InlineKeyboardMarkup<tl.TypeKeyboardInlineButton>;
|
|
190
|
+
export {};
|
|
@@ -135,10 +135,17 @@ class Dialog {
|
|
|
135
135
|
/**
|
|
136
136
|
* Whether this dialog is muted.
|
|
137
137
|
*
|
|
138
|
+
* Accounts for both the `silent` flag and the `muteUntil` timestamp
|
|
139
|
+
* (a peer muted until a future date is considered muted).
|
|
140
|
+
*
|
|
138
141
|
* If `null`, the default account-level setting should be used.
|
|
139
142
|
*/
|
|
140
143
|
get isMuted() {
|
|
141
|
-
|
|
144
|
+
const { silent, muteUntil } = this.raw.notifySettings;
|
|
145
|
+
if (muteUntil !== void 0) {
|
|
146
|
+
return muteUntil > Date.now() / 1e3;
|
|
147
|
+
}
|
|
148
|
+
return silent ?? null;
|
|
142
149
|
}
|
|
143
150
|
/**
|
|
144
151
|
* Whether this dialog is archived
|
|
@@ -60,6 +60,9 @@ export declare class Dialog {
|
|
|
60
60
|
/**
|
|
61
61
|
* Whether this dialog is muted.
|
|
62
62
|
*
|
|
63
|
+
* Accounts for both the `silent` flag and the `muteUntil` timestamp
|
|
64
|
+
* (a peer muted until a future date is considered muted).
|
|
65
|
+
*
|
|
63
66
|
* If `null`, the default account-level setting should be used.
|
|
64
67
|
*/
|
|
65
68
|
get isMuted(): boolean | null;
|
|
@@ -60,6 +60,9 @@ export declare class Dialog {
|
|
|
60
60
|
/**
|
|
61
61
|
* Whether this dialog is muted.
|
|
62
62
|
*
|
|
63
|
+
* Accounts for both the `silent` flag and the `muteUntil` timestamp
|
|
64
|
+
* (a peer muted until a future date is considered muted).
|
|
65
|
+
*
|
|
63
66
|
* If `null`, the default account-level setting should be used.
|
|
64
67
|
*/
|
|
65
68
|
get isMuted(): boolean | null;
|
|
@@ -128,10 +128,17 @@ class Dialog {
|
|
|
128
128
|
/**
|
|
129
129
|
* Whether this dialog is muted.
|
|
130
130
|
*
|
|
131
|
+
* Accounts for both the `silent` flag and the `muteUntil` timestamp
|
|
132
|
+
* (a peer muted until a future date is considered muted).
|
|
133
|
+
*
|
|
131
134
|
* If `null`, the default account-level setting should be used.
|
|
132
135
|
*/
|
|
133
136
|
get isMuted() {
|
|
134
|
-
|
|
137
|
+
const { silent, muteUntil } = this.raw.notifySettings;
|
|
138
|
+
if (muteUntil !== void 0) {
|
|
139
|
+
return muteUntil > Date.now() / 1e3;
|
|
140
|
+
}
|
|
141
|
+
return silent ?? null;
|
|
135
142
|
}
|
|
136
143
|
/**
|
|
137
144
|
* Whether this dialog is archived
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,6 +10,7 @@ const peer = require("../peers/peer.cjs");
|
|
|
10
10
|
const user = require("../peers/user.cjs");
|
|
11
11
|
const messageEntity = require("./message-entity.cjs");
|
|
12
12
|
const messageMedia = require("./message-media.cjs");
|
|
13
|
+
const richMessage = require("./rich/rich-message.cjs");
|
|
13
14
|
const inspectable = require("../../utils/inspectable.cjs");
|
|
14
15
|
class EphemeralMessage {
|
|
15
16
|
constructor(raw, _peers) {
|
|
@@ -28,9 +29,28 @@ class EphemeralMessage {
|
|
|
28
29
|
get sender() {
|
|
29
30
|
return peer.parsePeer(this.raw.fromId, this._peers);
|
|
30
31
|
}
|
|
31
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Chat where this message was sent.
|
|
34
|
+
*
|
|
35
|
+
* `null` if not available (e.g. welcome message templates)
|
|
36
|
+
*/
|
|
32
37
|
get chat() {
|
|
33
|
-
return peer.parsePeer(this.raw.peerId, this._peers);
|
|
38
|
+
return this.raw.peerId ? peer.parsePeer(this.raw.peerId, this._peers) : null;
|
|
39
|
+
}
|
|
40
|
+
/** Whether this message is a welcome message template */
|
|
41
|
+
get isWelcomeTemplate() {
|
|
42
|
+
return this.raw.welcomeTemplate;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* If set, any eventual webpage preview should be shown on top of
|
|
46
|
+
* the message instead of at the bottom.
|
|
47
|
+
*/
|
|
48
|
+
get invertMedia() {
|
|
49
|
+
return this.raw.invertMedia;
|
|
50
|
+
}
|
|
51
|
+
/** Whether this message can't be forwarded */
|
|
52
|
+
get isContentProtected() {
|
|
53
|
+
return this.raw.noforwards;
|
|
34
54
|
}
|
|
35
55
|
/** ID of the user this message is visible to */
|
|
36
56
|
get receiverId() {
|
|
@@ -97,7 +117,19 @@ class EphemeralMessage {
|
|
|
97
117
|
get replyTo() {
|
|
98
118
|
return this.raw.replyTo ?? null;
|
|
99
119
|
}
|
|
120
|
+
/** Rich message content, if any */
|
|
121
|
+
get richMessage() {
|
|
122
|
+
return this.raw.richMessage ? new richMessage.RichMessage(this.raw.richMessage) : null;
|
|
123
|
+
}
|
|
124
|
+
/** Identifier uniquely corresponding to the chat this message was sent to, if any */
|
|
125
|
+
get chatInstance() {
|
|
126
|
+
return this.raw.chatInstance ?? null;
|
|
127
|
+
}
|
|
128
|
+
/** ID of the message this message is anchored to, if any */
|
|
129
|
+
get anchorMessageId() {
|
|
130
|
+
return this.raw.anchorMsgId ?? null;
|
|
131
|
+
}
|
|
100
132
|
}
|
|
101
|
-
const EphemeralMessage$1 = /* @__PURE__ */ memoize.memoizeGetters(EphemeralMessage, ["sender", "chat", "receiver", "entities", "media"]);
|
|
133
|
+
const EphemeralMessage$1 = /* @__PURE__ */ memoize.memoizeGetters(EphemeralMessage, ["sender", "chat", "receiver", "entities", "media", "richMessage"]);
|
|
102
134
|
const EphemeralMessage$2 = /* @__PURE__ */ inspectable.makeInspectable(EphemeralMessage$1);
|
|
103
135
|
exports.EphemeralMessage = EphemeralMessage$2;
|
|
@@ -5,6 +5,7 @@ import { PeersIndex } from '../peers/peers-index.js';
|
|
|
5
5
|
import { MessageMedia } from './message-media.js';
|
|
6
6
|
import { User } from '../peers/user.js';
|
|
7
7
|
import { MessageEntity } from './message-entity.js';
|
|
8
|
+
import { RichMessage } from './rich/rich-message.js';
|
|
8
9
|
/**
|
|
9
10
|
* An ephemeral message — a message sent by a bot that is only visible
|
|
10
11
|
* to a single user in a chat and is not persisted in the chat history.
|
|
@@ -19,8 +20,21 @@ export declare class EphemeralMessage {
|
|
|
19
20
|
get isOutgoing(): boolean;
|
|
20
21
|
/** Sender of this message (usually the bot) */
|
|
21
22
|
get sender(): Peer;
|
|
22
|
-
/**
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Chat where this message was sent.
|
|
25
|
+
*
|
|
26
|
+
* `null` if not available (e.g. welcome message templates)
|
|
27
|
+
*/
|
|
28
|
+
get chat(): Peer | null;
|
|
29
|
+
/** Whether this message is a welcome message template */
|
|
30
|
+
get isWelcomeTemplate(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* If set, any eventual webpage preview should be shown on top of
|
|
33
|
+
* the message instead of at the bottom.
|
|
34
|
+
*/
|
|
35
|
+
get invertMedia(): boolean;
|
|
36
|
+
/** Whether this message can't be forwarded */
|
|
37
|
+
get isContentProtected(): boolean;
|
|
24
38
|
/** ID of the user this message is visible to */
|
|
25
39
|
get receiverId(): number;
|
|
26
40
|
/**
|
|
@@ -52,4 +66,10 @@ export declare class EphemeralMessage {
|
|
|
52
66
|
get replyMarkup(): tl.TypeReplyMarkup | null;
|
|
53
67
|
/** Information about the message this message is a reply to, if any */
|
|
54
68
|
get replyTo(): tl.TypeMessageReplyHeader | null;
|
|
69
|
+
/** Rich message content, if any */
|
|
70
|
+
get richMessage(): RichMessage | null;
|
|
71
|
+
/** Identifier uniquely corresponding to the chat this message was sent to, if any */
|
|
72
|
+
get chatInstance(): tl.Long | null;
|
|
73
|
+
/** ID of the message this message is anchored to, if any */
|
|
74
|
+
get anchorMessageId(): number | null;
|
|
55
75
|
}
|