@mtcute/core 0.31.0 → 0.32.0
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 +74 -9
- package/highlevel/client.d.ts +74 -9
- 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/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
|
@@ -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
|
}
|
|
@@ -3,6 +3,7 @@ import { parsePeer } from "../peers/peer.js";
|
|
|
3
3
|
import { User as User$2 } from "../peers/user.js";
|
|
4
4
|
import { MessageEntity as MessageEntity$2 } from "./message-entity.js";
|
|
5
5
|
import { _messageMediaFromTl } from "./message-media.js";
|
|
6
|
+
import { RichMessage as RichMessage$2 } from "./rich/rich-message.js";
|
|
6
7
|
import { makeInspectable } from "../../utils/inspectable.js";
|
|
7
8
|
class EphemeralMessage {
|
|
8
9
|
constructor(raw, _peers) {
|
|
@@ -21,9 +22,28 @@ class EphemeralMessage {
|
|
|
21
22
|
get sender() {
|
|
22
23
|
return parsePeer(this.raw.fromId, this._peers);
|
|
23
24
|
}
|
|
24
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Chat where this message was sent.
|
|
27
|
+
*
|
|
28
|
+
* `null` if not available (e.g. welcome message templates)
|
|
29
|
+
*/
|
|
25
30
|
get chat() {
|
|
26
|
-
return parsePeer(this.raw.peerId, this._peers);
|
|
31
|
+
return this.raw.peerId ? parsePeer(this.raw.peerId, this._peers) : null;
|
|
32
|
+
}
|
|
33
|
+
/** Whether this message is a welcome message template */
|
|
34
|
+
get isWelcomeTemplate() {
|
|
35
|
+
return this.raw.welcomeTemplate;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* If set, any eventual webpage preview should be shown on top of
|
|
39
|
+
* the message instead of at the bottom.
|
|
40
|
+
*/
|
|
41
|
+
get invertMedia() {
|
|
42
|
+
return this.raw.invertMedia;
|
|
43
|
+
}
|
|
44
|
+
/** Whether this message can't be forwarded */
|
|
45
|
+
get isContentProtected() {
|
|
46
|
+
return this.raw.noforwards;
|
|
27
47
|
}
|
|
28
48
|
/** ID of the user this message is visible to */
|
|
29
49
|
get receiverId() {
|
|
@@ -90,8 +110,20 @@ class EphemeralMessage {
|
|
|
90
110
|
get replyTo() {
|
|
91
111
|
return this.raw.replyTo ?? null;
|
|
92
112
|
}
|
|
113
|
+
/** Rich message content, if any */
|
|
114
|
+
get richMessage() {
|
|
115
|
+
return this.raw.richMessage ? new RichMessage$2(this.raw.richMessage) : null;
|
|
116
|
+
}
|
|
117
|
+
/** Identifier uniquely corresponding to the chat this message was sent to, if any */
|
|
118
|
+
get chatInstance() {
|
|
119
|
+
return this.raw.chatInstance ?? null;
|
|
120
|
+
}
|
|
121
|
+
/** ID of the message this message is anchored to, if any */
|
|
122
|
+
get anchorMessageId() {
|
|
123
|
+
return this.raw.anchorMsgId ?? null;
|
|
124
|
+
}
|
|
93
125
|
}
|
|
94
|
-
const EphemeralMessage$1 = /* @__PURE__ */ memoizeGetters(EphemeralMessage, ["sender", "chat", "receiver", "entities", "media"]);
|
|
126
|
+
const EphemeralMessage$1 = /* @__PURE__ */ memoizeGetters(EphemeralMessage, ["sender", "chat", "receiver", "entities", "media", "richMessage"]);
|
|
95
127
|
const EphemeralMessage$2 = /* @__PURE__ */ makeInspectable(EphemeralMessage$1);
|
|
96
128
|
export {
|
|
97
129
|
EphemeralMessage$2 as EphemeralMessage
|
|
@@ -205,6 +205,11 @@ function _messageActionFromTl(act) {
|
|
|
205
205
|
return {
|
|
206
206
|
type: "user_joined_approved"
|
|
207
207
|
};
|
|
208
|
+
case "messageActionChatJoinedViaCommunity":
|
|
209
|
+
return {
|
|
210
|
+
type: "user_joined_community",
|
|
211
|
+
community: new chat.Chat(this._peers.chat(act.communityId))
|
|
212
|
+
};
|
|
208
213
|
case "messageActionWebViewDataSent":
|
|
209
214
|
return {
|
|
210
215
|
type: "webview_sent",
|
|
@@ -341,7 +346,9 @@ function _messageActionFromTl(act) {
|
|
|
341
346
|
canExportAt: act.canExportAt ? new Date(act.canExportAt * 1e3) : void 0,
|
|
342
347
|
canCraftAt: act.canCraftAt ? new Date(act.canCraftAt * 1e3) : void 0,
|
|
343
348
|
savedId: act.savedId,
|
|
344
|
-
dropDetailsStars: act.dropOriginalDetailsStars
|
|
349
|
+
dropDetailsStars: act.dropOriginalDetailsStars,
|
|
350
|
+
nameHidden: act.nameHidden,
|
|
351
|
+
message: act.message
|
|
345
352
|
};
|
|
346
353
|
if (act.assigned) {
|
|
347
354
|
return {
|
|
@@ -104,6 +104,12 @@ export interface ActionUserJoinedLink {
|
|
|
104
104
|
export interface ActionUserJoinedApproved {
|
|
105
105
|
readonly type: 'user_joined_approved';
|
|
106
106
|
}
|
|
107
|
+
/** User has joined the group because they are a member of a community */
|
|
108
|
+
export interface ActionUserJoinedViaCommunity {
|
|
109
|
+
readonly type: 'user_joined_community';
|
|
110
|
+
/** Community the user has joined via */
|
|
111
|
+
readonly community: Chat;
|
|
112
|
+
}
|
|
107
113
|
/** A payment was received from a user (bot) */
|
|
108
114
|
export interface ActionPaymentReceived {
|
|
109
115
|
readonly type: 'payment_received';
|
|
@@ -477,6 +483,10 @@ interface StarGiftUniqueCommon {
|
|
|
477
483
|
dropDetailsStars?: tl.Long;
|
|
478
484
|
/** ID of the related saved profile gift */
|
|
479
485
|
savedId?: tl.Long;
|
|
486
|
+
/** Whether the name of the sender/buyer is hidden */
|
|
487
|
+
nameHidden: boolean;
|
|
488
|
+
/** Message attached to the gift, if any */
|
|
489
|
+
message?: TextWithEntities;
|
|
480
490
|
}
|
|
481
491
|
/** A star gift was upgraded to a unique one */
|
|
482
492
|
export interface ActionStarGiftUpgraded extends StarGiftUniqueCommon {
|
|
@@ -628,7 +638,7 @@ export interface ActionChangeCreator {
|
|
|
628
638
|
/** New creator */
|
|
629
639
|
newCreator: User;
|
|
630
640
|
}
|
|
631
|
-
export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | ActionStarGiftCrafted | ActionNewCreatorPending | ActionChangeCreator | ActionNoForwardsToggle | ActionNoForwardsRequest | ActionPollAppendAnswer | ActionPollDeleteAnswer | ActionManagedBotCreated | ActionChangeCommunity | null;
|
|
641
|
+
export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionUserJoinedViaCommunity | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | ActionStarGiftCrafted | ActionNewCreatorPending | ActionChangeCreator | ActionNoForwardsToggle | ActionNoForwardsRequest | ActionPollAppendAnswer | ActionPollDeleteAnswer | ActionManagedBotCreated | ActionChangeCommunity | null;
|
|
632
642
|
/** @internal */
|
|
633
643
|
export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
|
|
634
644
|
export {};
|
|
@@ -104,6 +104,12 @@ export interface ActionUserJoinedLink {
|
|
|
104
104
|
export interface ActionUserJoinedApproved {
|
|
105
105
|
readonly type: 'user_joined_approved';
|
|
106
106
|
}
|
|
107
|
+
/** User has joined the group because they are a member of a community */
|
|
108
|
+
export interface ActionUserJoinedViaCommunity {
|
|
109
|
+
readonly type: 'user_joined_community';
|
|
110
|
+
/** Community the user has joined via */
|
|
111
|
+
readonly community: Chat;
|
|
112
|
+
}
|
|
107
113
|
/** A payment was received from a user (bot) */
|
|
108
114
|
export interface ActionPaymentReceived {
|
|
109
115
|
readonly type: 'payment_received';
|
|
@@ -477,6 +483,10 @@ interface StarGiftUniqueCommon {
|
|
|
477
483
|
dropDetailsStars?: tl.Long;
|
|
478
484
|
/** ID of the related saved profile gift */
|
|
479
485
|
savedId?: tl.Long;
|
|
486
|
+
/** Whether the name of the sender/buyer is hidden */
|
|
487
|
+
nameHidden: boolean;
|
|
488
|
+
/** Message attached to the gift, if any */
|
|
489
|
+
message?: TextWithEntities;
|
|
480
490
|
}
|
|
481
491
|
/** A star gift was upgraded to a unique one */
|
|
482
492
|
export interface ActionStarGiftUpgraded extends StarGiftUniqueCommon {
|
|
@@ -628,7 +638,7 @@ export interface ActionChangeCreator {
|
|
|
628
638
|
/** New creator */
|
|
629
639
|
newCreator: User;
|
|
630
640
|
}
|
|
631
|
-
export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | ActionStarGiftCrafted | ActionNewCreatorPending | ActionChangeCreator | ActionNoForwardsToggle | ActionNoForwardsRequest | ActionPollAppendAnswer | ActionPollDeleteAnswer | ActionManagedBotCreated | ActionChangeCommunity | null;
|
|
641
|
+
export type MessageAction = ActionChatCreated | ActionChannelCreated | ActionChatMigrateTo | ActionChannelMigrateFrom | ActionMessagePinned | ActionHistoryCleared | ActionGameScore | ActionContactJoined | ActionTitleChanged | ActionPhotoChanged | ActionPhotoDeleted | ActionUsersAdded | ActionUserLeft | ActionUserRemoved | ActionUserJoinedLink | ActionPaymentReceived | ActionPaymentSent | ActionCall | ActionScreenshotTaken | ActionBotAllowed | ActionGeoProximity | ActionGroupCallStarted | ActionGroupCallEnded | ActionGroupCallScheduled | ActionGroupInvite | ActionTtlChanged | ActionTopicCreated | ActionTopicEdited | ActionCustom | ActionThemeChanged | ActionThemeChangedUnique | ActionUserJoinedApproved | ActionUserJoinedViaCommunity | ActionWebviewDataSent | ActionWebviewDataReceived | ActionPremiumGifted | ActionPhotoSuggested | ActionPeerSent | ActionPeerChosen | ActionWallpaperChanged | ActionGiftCode | ActionGiveawayStarted | ActionGiveawayEnded | ActionBoostApply | ActionPaymentRefunded | ActionStarGifted | ActionStarsPrize | ActionStarGiftSent | ActionStarGiftUpgradePaid | ActionStarGiftUpgraded | ActionStarGiftBoughtResale | ActionStarGiftTransferred | ActionStarGiftAssigned | ActionPaidMessagesPaid | ActionPaidMessagesRefunded | ActionTodoCompletions | ActionTodoAppendTasks | ActionTonGift | ActionSuggestBirthday | ActionStarGiftPurchaseOffer | ActionStarGiftPurchaseOfferDeclined | ActionStarGiftBoughtOffer | ActionStarGiftCrafted | ActionNewCreatorPending | ActionChangeCreator | ActionNoForwardsToggle | ActionNoForwardsRequest | ActionPollAppendAnswer | ActionPollDeleteAnswer | ActionManagedBotCreated | ActionChangeCommunity | null;
|
|
632
642
|
/** @internal */
|
|
633
643
|
export declare function _messageActionFromTl(this: Message, act: tl.TypeMessageAction): MessageAction;
|
|
634
644
|
export {};
|
|
@@ -198,6 +198,11 @@ function _messageActionFromTl(act) {
|
|
|
198
198
|
return {
|
|
199
199
|
type: "user_joined_approved"
|
|
200
200
|
};
|
|
201
|
+
case "messageActionChatJoinedViaCommunity":
|
|
202
|
+
return {
|
|
203
|
+
type: "user_joined_community",
|
|
204
|
+
community: new Chat$2(this._peers.chat(act.communityId))
|
|
205
|
+
};
|
|
201
206
|
case "messageActionWebViewDataSent":
|
|
202
207
|
return {
|
|
203
208
|
type: "webview_sent",
|
|
@@ -334,7 +339,9 @@ function _messageActionFromTl(act) {
|
|
|
334
339
|
canExportAt: act.canExportAt ? new Date(act.canExportAt * 1e3) : void 0,
|
|
335
340
|
canCraftAt: act.canCraftAt ? new Date(act.canCraftAt * 1e3) : void 0,
|
|
336
341
|
savedId: act.savedId,
|
|
337
|
-
dropDetailsStars: act.dropOriginalDetailsStars
|
|
342
|
+
dropDetailsStars: act.dropOriginalDetailsStars,
|
|
343
|
+
nameHidden: act.nameHidden,
|
|
344
|
+
message: act.message
|
|
338
345
|
};
|
|
339
346
|
if (act.assigned) {
|
|
340
347
|
return {
|
|
@@ -379,7 +379,8 @@ class Message {
|
|
|
379
379
|
return {
|
|
380
380
|
type: "force_reply",
|
|
381
381
|
singleUse: rm.singleUse,
|
|
382
|
-
selective: rm.selective
|
|
382
|
+
selective: rm.selective,
|
|
383
|
+
placeholder: rm.placeholder
|
|
383
384
|
};
|
|
384
385
|
case "replyKeyboardMarkup":
|
|
385
386
|
return {
|
|
@@ -387,12 +388,16 @@ class Message {
|
|
|
387
388
|
resize: rm.resize,
|
|
388
389
|
singleUse: rm.singleUse,
|
|
389
390
|
selective: rm.selective,
|
|
391
|
+
persistent: rm.persistent,
|
|
392
|
+
forceReply: rm.forceReply,
|
|
393
|
+
placeholder: rm.placeholder,
|
|
390
394
|
buttons: factories._rowsTo2d(rm.rows)
|
|
391
395
|
};
|
|
392
396
|
case "replyInlineMarkup":
|
|
393
397
|
return {
|
|
394
398
|
type: "inline",
|
|
395
|
-
|
|
399
|
+
forceReply: rm.forceReply,
|
|
400
|
+
buttons: factories._inlineRowsTo2d(rm.rows)
|
|
396
401
|
};
|
|
397
402
|
default:
|
|
398
403
|
utils.assertNever();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tl } from '../../../tl/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { ParsedReplyMarkup } from '../bots/keyboards/index.js';
|
|
3
3
|
import { TextWithEntities } from '../misc/index.js';
|
|
4
4
|
import { Peer } from '../peers/peer.js';
|
|
5
5
|
import { PeersIndex } from '../peers/peers-index.js';
|
|
@@ -232,7 +232,7 @@ export declare class Message {
|
|
|
232
232
|
/**
|
|
233
233
|
* Reply markup provided with this message, if any.
|
|
234
234
|
*/
|
|
235
|
-
get markup():
|
|
235
|
+
get markup(): ParsedReplyMarkup | null;
|
|
236
236
|
/**
|
|
237
237
|
* Whether this message can be forwarded
|
|
238
238
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tl } from '../../../tl/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { ParsedReplyMarkup } from '../bots/keyboards/index.js';
|
|
3
3
|
import { TextWithEntities } from '../misc/index.js';
|
|
4
4
|
import { Peer } from '../peers/peer.js';
|
|
5
5
|
import { PeersIndex } from '../peers/peers-index.js';
|
|
@@ -232,7 +232,7 @@ export declare class Message {
|
|
|
232
232
|
/**
|
|
233
233
|
* Reply markup provided with this message, if any.
|
|
234
234
|
*/
|
|
235
|
-
get markup():
|
|
235
|
+
get markup(): ParsedReplyMarkup | null;
|
|
236
236
|
/**
|
|
237
237
|
* Whether this message can be forwarded
|
|
238
238
|
*
|
|
@@ -16,7 +16,7 @@ import { RepliedMessageInfo as RepliedMessageInfo$2 } from "./replied-message.js
|
|
|
16
16
|
import { RichMessage as RichMessage$2 } from "./rich/rich-message.js";
|
|
17
17
|
import { SuggestedPostInfo as SuggestedPostInfo$1 } from "./suggested-post.js";
|
|
18
18
|
import { makeInspectable } from "../../utils/inspectable.js";
|
|
19
|
-
import { _rowsTo2d } from "../bots/keyboards/factories.js";
|
|
19
|
+
import { _inlineRowsTo2d, _rowsTo2d } from "../bots/keyboards/factories.js";
|
|
20
20
|
class Message {
|
|
21
21
|
constructor(raw, _peers, isScheduled = false) {
|
|
22
22
|
this._peers = _peers;
|
|
@@ -372,7 +372,8 @@ class Message {
|
|
|
372
372
|
return {
|
|
373
373
|
type: "force_reply",
|
|
374
374
|
singleUse: rm.singleUse,
|
|
375
|
-
selective: rm.selective
|
|
375
|
+
selective: rm.selective,
|
|
376
|
+
placeholder: rm.placeholder
|
|
376
377
|
};
|
|
377
378
|
case "replyKeyboardMarkup":
|
|
378
379
|
return {
|
|
@@ -380,12 +381,16 @@ class Message {
|
|
|
380
381
|
resize: rm.resize,
|
|
381
382
|
singleUse: rm.singleUse,
|
|
382
383
|
selective: rm.selective,
|
|
384
|
+
persistent: rm.persistent,
|
|
385
|
+
forceReply: rm.forceReply,
|
|
386
|
+
placeholder: rm.placeholder,
|
|
383
387
|
buttons: _rowsTo2d(rm.rows)
|
|
384
388
|
};
|
|
385
389
|
case "replyInlineMarkup":
|
|
386
390
|
return {
|
|
387
391
|
type: "inline",
|
|
388
|
-
|
|
392
|
+
forceReply: rm.forceReply,
|
|
393
|
+
buttons: _inlineRowsTo2d(rm.rows)
|
|
389
394
|
};
|
|
390
395
|
default:
|
|
391
396
|
assertNever();
|
|
@@ -6,7 +6,9 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const Long = require("long");
|
|
9
|
+
const errors = require("../../../../types/errors.cjs");
|
|
9
10
|
const entities = require("../../../utils/entities.cjs");
|
|
11
|
+
const normalize = require("../../bots/keyboards/normalize.cjs");
|
|
10
12
|
const RICH_EMPTY = { _: "textEmpty" };
|
|
11
13
|
function normalizeRichText(text) {
|
|
12
14
|
if (typeof text === "string") return { _: "textPlain", text };
|
|
@@ -55,6 +57,38 @@ function blockquote(content, caption) {
|
|
|
55
57
|
}
|
|
56
58
|
return { _: "pageBlockBlockquote", text: normalizeRichText(content), caption: normalizedCaption };
|
|
57
59
|
}
|
|
60
|
+
function normalizeButton(btn, text) {
|
|
61
|
+
if ("_" in btn) {
|
|
62
|
+
if (btn._ !== "keyboardInlineButton") {
|
|
63
|
+
throw new errors.MtArgumentError("reply keyboard buttons cannot be used in rich messages");
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
text: normalizeRichText(text ?? btn.text),
|
|
67
|
+
type: btn.type,
|
|
68
|
+
style: void 0
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
text: normalizeRichText(text ?? btn.text),
|
|
73
|
+
type: normalize._toInlineButtonType(btn),
|
|
74
|
+
style: normalize._toRichButtonStyle(btn.style)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function textButton(button2, text) {
|
|
78
|
+
return { _: "textButton", ...normalizeButton(button2, text) };
|
|
79
|
+
}
|
|
80
|
+
function button(button2, text) {
|
|
81
|
+
return { _: "pageButton", ...normalizeButton(button2, text) };
|
|
82
|
+
}
|
|
83
|
+
function buttonRow(buttons, params = {}) {
|
|
84
|
+
return {
|
|
85
|
+
_: "pageBlockButtonRow",
|
|
86
|
+
alignLeft: params.align === "left" || void 0,
|
|
87
|
+
alignCenter: params.align === "center" || void 0,
|
|
88
|
+
alignRight: params.align === "right" || void 0,
|
|
89
|
+
buttons: buttons.map((it) => "_" in it && it._ === "pageButton" ? it : button(it))
|
|
90
|
+
};
|
|
91
|
+
}
|
|
58
92
|
function pullquote(text, caption) {
|
|
59
93
|
return {
|
|
60
94
|
_: "pageBlockPullquote",
|
|
@@ -196,6 +230,8 @@ function audio(file, params = {}) {
|
|
|
196
230
|
exports.anchor = anchor;
|
|
197
231
|
exports.audio = audio;
|
|
198
232
|
exports.blockquote = blockquote;
|
|
233
|
+
exports.button = button;
|
|
234
|
+
exports.buttonRow = buttonRow;
|
|
199
235
|
exports.collage = collage;
|
|
200
236
|
exports.details = details;
|
|
201
237
|
exports.divider = divider;
|
|
@@ -215,5 +251,6 @@ exports.slideshow = slideshow;
|
|
|
215
251
|
exports.table = table;
|
|
216
252
|
exports.tableCell = tableCell;
|
|
217
253
|
exports.tableRow = tableRow;
|
|
254
|
+
exports.textButton = textButton;
|
|
218
255
|
exports.thinking = thinking;
|
|
219
256
|
exports.video = video;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tl } from '../../../../tl/index.js';
|
|
2
|
+
import { InputInlineKeyboardButton } from '../../bots/keyboards/types.js';
|
|
2
3
|
import { InputMediaAudio, InputMediaPhoto, InputMediaVideo } from '../../media/index.js';
|
|
3
4
|
import { InputText } from '../../misc/entities.js';
|
|
4
5
|
import { InputPageBlock, InputPageBlockOrFile, InputPageBlockWithFile } from './types.js';
|
|
@@ -48,6 +49,24 @@ export declare function preformatted(text: InputRichText, language?: string): tl
|
|
|
48
49
|
* containing other blocks (`pageBlockBlockquoteBlocks`).
|
|
49
50
|
*/
|
|
50
51
|
export declare function blockquote(content: InputRichText | InputPageBlockOrFile[], caption?: InputRichText): tl.RawPageBlockBlockquote | Block<'pageBlockBlockquoteBlocks'>;
|
|
52
|
+
/**
|
|
53
|
+
* Create an inline button inside rich text
|
|
54
|
+
*
|
|
55
|
+
* @param button Button to render (see {@link BotKeyboard})
|
|
56
|
+
* @param text Rich text to use as the button label, defaults to the button's own text
|
|
57
|
+
*/
|
|
58
|
+
export declare function textButton(button: InputInlineKeyboardButton, text?: InputRichText): tl.RawTextButton;
|
|
59
|
+
/** Create a button to be used inside a {@link buttonRow} */
|
|
60
|
+
export declare function button(button: InputInlineKeyboardButton, text?: InputRichText): tl.RawPageButton;
|
|
61
|
+
/**
|
|
62
|
+
* Create a row of buttons
|
|
63
|
+
*
|
|
64
|
+
* @param buttons Buttons in the row (see {@link BotKeyboard}), or raw `pageButton`s
|
|
65
|
+
* @param params Alignment of the row
|
|
66
|
+
*/
|
|
67
|
+
export declare function buttonRow(buttons: (InputInlineKeyboardButton | tl.RawPageButton)[], params?: {
|
|
68
|
+
align?: 'left' | 'center' | 'right';
|
|
69
|
+
}): tl.RawPageBlockButtonRow;
|
|
51
70
|
/** Create a pullquote block */
|
|
52
71
|
export declare function pullquote(text: InputRichText, caption?: InputRichText): tl.RawPageBlockPullquote;
|
|
53
72
|
/** Create a map block */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tl } from '../../../../tl/index.js';
|
|
2
|
+
import { InputInlineKeyboardButton } from '../../bots/keyboards/types.js';
|
|
2
3
|
import { InputMediaAudio, InputMediaPhoto, InputMediaVideo } from '../../media/index.js';
|
|
3
4
|
import { InputText } from '../../misc/entities.js';
|
|
4
5
|
import { InputPageBlock, InputPageBlockOrFile, InputPageBlockWithFile } from './types.js';
|
|
@@ -48,6 +49,24 @@ export declare function preformatted(text: InputRichText, language?: string): tl
|
|
|
48
49
|
* containing other blocks (`pageBlockBlockquoteBlocks`).
|
|
49
50
|
*/
|
|
50
51
|
export declare function blockquote(content: InputRichText | InputPageBlockOrFile[], caption?: InputRichText): tl.RawPageBlockBlockquote | Block<'pageBlockBlockquoteBlocks'>;
|
|
52
|
+
/**
|
|
53
|
+
* Create an inline button inside rich text
|
|
54
|
+
*
|
|
55
|
+
* @param button Button to render (see {@link BotKeyboard})
|
|
56
|
+
* @param text Rich text to use as the button label, defaults to the button's own text
|
|
57
|
+
*/
|
|
58
|
+
export declare function textButton(button: InputInlineKeyboardButton, text?: InputRichText): tl.RawTextButton;
|
|
59
|
+
/** Create a button to be used inside a {@link buttonRow} */
|
|
60
|
+
export declare function button(button: InputInlineKeyboardButton, text?: InputRichText): tl.RawPageButton;
|
|
61
|
+
/**
|
|
62
|
+
* Create a row of buttons
|
|
63
|
+
*
|
|
64
|
+
* @param buttons Buttons in the row (see {@link BotKeyboard}), or raw `pageButton`s
|
|
65
|
+
* @param params Alignment of the row
|
|
66
|
+
*/
|
|
67
|
+
export declare function buttonRow(buttons: (InputInlineKeyboardButton | tl.RawPageButton)[], params?: {
|
|
68
|
+
align?: 'left' | 'center' | 'right';
|
|
69
|
+
}): tl.RawPageBlockButtonRow;
|
|
51
70
|
/** Create a pullquote block */
|
|
52
71
|
export declare function pullquote(text: InputRichText, caption?: InputRichText): tl.RawPageBlockPullquote;
|
|
53
72
|
/** Create a map block */
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
|
+
import { MtArgumentError } from "../../../../types/errors.js";
|
|
2
3
|
import { textWithEntitiesToRichText } from "../../../utils/entities.js";
|
|
4
|
+
import { _toRichButtonStyle, _toInlineButtonType } from "../../bots/keyboards/normalize.js";
|
|
3
5
|
const RICH_EMPTY = { _: "textEmpty" };
|
|
4
6
|
function normalizeRichText(text) {
|
|
5
7
|
if (typeof text === "string") return { _: "textPlain", text };
|
|
@@ -48,6 +50,38 @@ function blockquote(content, caption) {
|
|
|
48
50
|
}
|
|
49
51
|
return { _: "pageBlockBlockquote", text: normalizeRichText(content), caption: normalizedCaption };
|
|
50
52
|
}
|
|
53
|
+
function normalizeButton(btn, text) {
|
|
54
|
+
if ("_" in btn) {
|
|
55
|
+
if (btn._ !== "keyboardInlineButton") {
|
|
56
|
+
throw new MtArgumentError("reply keyboard buttons cannot be used in rich messages");
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
text: normalizeRichText(text ?? btn.text),
|
|
60
|
+
type: btn.type,
|
|
61
|
+
style: void 0
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
text: normalizeRichText(text ?? btn.text),
|
|
66
|
+
type: _toInlineButtonType(btn),
|
|
67
|
+
style: _toRichButtonStyle(btn.style)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function textButton(button2, text) {
|
|
71
|
+
return { _: "textButton", ...normalizeButton(button2, text) };
|
|
72
|
+
}
|
|
73
|
+
function button(button2, text) {
|
|
74
|
+
return { _: "pageButton", ...normalizeButton(button2, text) };
|
|
75
|
+
}
|
|
76
|
+
function buttonRow(buttons, params = {}) {
|
|
77
|
+
return {
|
|
78
|
+
_: "pageBlockButtonRow",
|
|
79
|
+
alignLeft: params.align === "left" || void 0,
|
|
80
|
+
alignCenter: params.align === "center" || void 0,
|
|
81
|
+
alignRight: params.align === "right" || void 0,
|
|
82
|
+
buttons: buttons.map((it) => "_" in it && it._ === "pageButton" ? it : button(it))
|
|
83
|
+
};
|
|
84
|
+
}
|
|
51
85
|
function pullquote(text, caption) {
|
|
52
86
|
return {
|
|
53
87
|
_: "pageBlockPullquote",
|
|
@@ -190,6 +224,8 @@ export {
|
|
|
190
224
|
anchor,
|
|
191
225
|
audio,
|
|
192
226
|
blockquote,
|
|
227
|
+
button,
|
|
228
|
+
buttonRow,
|
|
193
229
|
collage,
|
|
194
230
|
details,
|
|
195
231
|
divider,
|
|
@@ -209,6 +245,7 @@ export {
|
|
|
209
245
|
table,
|
|
210
246
|
tableCell,
|
|
211
247
|
tableRow,
|
|
248
|
+
textButton,
|
|
212
249
|
thinking,
|
|
213
250
|
video
|
|
214
251
|
};
|
|
@@ -312,6 +312,10 @@ class FullChat extends chat.Chat {
|
|
|
312
312
|
if (this.full._ !== "channelFull" || !this.full.botVerification) return null;
|
|
313
313
|
return new botVerification.BotVerification(this.full.botVerification);
|
|
314
314
|
}
|
|
315
|
+
/** Whether this chat has welcome messages configured */
|
|
316
|
+
get hasWelcomeMessages() {
|
|
317
|
+
return this.full._ !== "communityFull" && this.full.hasWelcomeMessages;
|
|
318
|
+
}
|
|
315
319
|
/** Whether star gifts are available in this chat */
|
|
316
320
|
get starGiftsAvailable() {
|
|
317
321
|
return this.full._ === "channelFull" && this.full.stargiftsAvailable;
|
|
@@ -167,6 +167,8 @@ export declare class FullChat extends Chat {
|
|
|
167
167
|
get stories(): PeerStories | null;
|
|
168
168
|
/** Information about a bot-issued verification (if any) */
|
|
169
169
|
get botVerification(): BotVerification | null;
|
|
170
|
+
/** Whether this chat has welcome messages configured */
|
|
171
|
+
get hasWelcomeMessages(): boolean;
|
|
170
172
|
/** Whether star gifts are available in this chat */
|
|
171
173
|
get starGiftsAvailable(): boolean;
|
|
172
174
|
/** Number of star gifts available in this chat */
|
|
@@ -167,6 +167,8 @@ export declare class FullChat extends Chat {
|
|
|
167
167
|
get stories(): PeerStories | null;
|
|
168
168
|
/** Information about a bot-issued verification (if any) */
|
|
169
169
|
get botVerification(): BotVerification | null;
|
|
170
|
+
/** Whether this chat has welcome messages configured */
|
|
171
|
+
get hasWelcomeMessages(): boolean;
|
|
170
172
|
/** Whether star gifts are available in this chat */
|
|
171
173
|
get starGiftsAvailable(): boolean;
|
|
172
174
|
/** Number of star gifts available in this chat */
|
|
@@ -305,6 +305,10 @@ class FullChat extends Chat$2 {
|
|
|
305
305
|
if (this.full._ !== "channelFull" || !this.full.botVerification) return null;
|
|
306
306
|
return new BotVerification$1(this.full.botVerification);
|
|
307
307
|
}
|
|
308
|
+
/** Whether this chat has welcome messages configured */
|
|
309
|
+
get hasWelcomeMessages() {
|
|
310
|
+
return this.full._ !== "communityFull" && this.full.hasWelcomeMessages;
|
|
311
|
+
}
|
|
308
312
|
/** Whether star gifts are available in this chat */
|
|
309
313
|
get starGiftsAvailable() {
|
|
310
314
|
return this.full._ === "channelFull" && this.full.stargiftsAvailable;
|
|
@@ -22,5 +22,8 @@
|
|
|
22
22
|
* - `sticker`: User is choosing a sticker
|
|
23
23
|
* - `interaction`: User has sent an emoji interaction
|
|
24
24
|
* - `interaction_seen`: User is watching a previously sent emoji interaction
|
|
25
|
+
* - `stop_draft`: User has requested to stop the ongoing draft streaming
|
|
25
26
|
*/
|
|
26
|
-
export type TypingStatus = 'typing' | 'cancel' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_photo' | 'upload_document' | 'geo' | 'contact' | 'game' | 'record_round' | 'upload_round' | 'speak_call' | 'history_import' | 'sticker' | 'interaction' | 'interaction_seen';
|
|
27
|
+
export type TypingStatus = 'typing' | 'cancel' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_photo' | 'upload_document' | 'geo' | 'contact' | 'game' | 'record_round' | 'upload_round' | 'speak_call' | 'history_import' | 'sticker' | 'interaction' | 'interaction_seen' | 'stop_draft';
|
|
28
|
+
/** {@link TypingStatus} values that can be sent by the client as-is */
|
|
29
|
+
export type SendableTypingStatus = Exclude<TypingStatus, 'interaction' | 'interaction_seen' | 'stop_draft'>;
|
|
@@ -22,5 +22,8 @@
|
|
|
22
22
|
* - `sticker`: User is choosing a sticker
|
|
23
23
|
* - `interaction`: User has sent an emoji interaction
|
|
24
24
|
* - `interaction_seen`: User is watching a previously sent emoji interaction
|
|
25
|
+
* - `stop_draft`: User has requested to stop the ongoing draft streaming
|
|
25
26
|
*/
|
|
26
|
-
export type TypingStatus = 'typing' | 'cancel' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_photo' | 'upload_document' | 'geo' | 'contact' | 'game' | 'record_round' | 'upload_round' | 'speak_call' | 'history_import' | 'sticker' | 'interaction' | 'interaction_seen';
|
|
27
|
+
export type TypingStatus = 'typing' | 'cancel' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_photo' | 'upload_document' | 'geo' | 'contact' | 'game' | 'record_round' | 'upload_round' | 'speak_call' | 'history_import' | 'sticker' | 'interaction' | 'interaction_seen' | 'stop_draft';
|
|
28
|
+
/** {@link TypingStatus} values that can be sent by the client as-is */
|
|
29
|
+
export type SendableTypingStatus = Exclude<TypingStatus, 'interaction' | 'interaction_seen' | 'stop_draft'>;
|
|
@@ -24,9 +24,17 @@ class EphemeralCallbackQuery {
|
|
|
24
24
|
get user() {
|
|
25
25
|
return new user.User(this._peers.user(this.raw.userId));
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Chat where the originating ephemeral message was sent.
|
|
29
|
+
*
|
|
30
|
+
* `null` if not available (see {@link chatInstance})
|
|
31
|
+
*/
|
|
28
32
|
get chat() {
|
|
29
|
-
return peer.parsePeer(this.raw.peer, this._peers);
|
|
33
|
+
return this.raw.peer ? peer.parsePeer(this.raw.peer, this._peers) : null;
|
|
34
|
+
}
|
|
35
|
+
/** Identifier uniquely corresponding to the chat the message was sent to, if any */
|
|
36
|
+
get chatInstance() {
|
|
37
|
+
return this.raw.chatInstance ?? null;
|
|
30
38
|
}
|
|
31
39
|
/** Identifier of the ephemeral message containing the button which was clicked */
|
|
32
40
|
get messageId() {
|
|
@@ -14,8 +14,14 @@ export declare class EphemeralCallbackQuery {
|
|
|
14
14
|
get id(): tl.Long;
|
|
15
15
|
/** User who has pressed the button */
|
|
16
16
|
get user(): User;
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Chat where the originating ephemeral message was sent.
|
|
19
|
+
*
|
|
20
|
+
* `null` if not available (see {@link chatInstance})
|
|
21
|
+
*/
|
|
22
|
+
get chat(): Peer | null;
|
|
23
|
+
/** Identifier uniquely corresponding to the chat the message was sent to, if any */
|
|
24
|
+
get chatInstance(): tl.Long | null;
|
|
19
25
|
/** Identifier of the ephemeral message containing the button which was clicked */
|
|
20
26
|
get messageId(): number;
|
|
21
27
|
/** The originating ephemeral message */
|
|
@@ -14,8 +14,14 @@ export declare class EphemeralCallbackQuery {
|
|
|
14
14
|
get id(): tl.Long;
|
|
15
15
|
/** User who has pressed the button */
|
|
16
16
|
get user(): User;
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Chat where the originating ephemeral message was sent.
|
|
19
|
+
*
|
|
20
|
+
* `null` if not available (see {@link chatInstance})
|
|
21
|
+
*/
|
|
22
|
+
get chat(): Peer | null;
|
|
23
|
+
/** Identifier uniquely corresponding to the chat the message was sent to, if any */
|
|
24
|
+
get chatInstance(): tl.Long | null;
|
|
19
25
|
/** Identifier of the ephemeral message containing the button which was clicked */
|
|
20
26
|
get messageId(): number;
|
|
21
27
|
/** The originating ephemeral message */
|