@mtkruto/node 0.0.957 → 0.0.960
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/client/0_utilities.d.ts +3 -0
- package/esm/client/0_utilities.js +20 -0
- package/esm/client/3_client.d.ts +2 -2
- package/esm/client/3_client.js +57 -16
- package/esm/constants.d.ts +1 -1
- package/esm/constants.js +1 -1
- package/esm/storage/0_storage.d.ts +16 -17
- package/esm/storage/0_storage.js +65 -131
- package/esm/storage/0_utilities.d.ts +13 -0
- package/esm/storage/0_utilities.js +62 -0
- package/esm/storage/1_storage_indexed_db.d.ts +3 -3
- package/esm/storage/1_storage_indexed_db.js +4 -3
- package/esm/storage/1_storage_local_storage.d.ts +3 -3
- package/esm/storage/1_storage_local_storage.js +13 -6
- package/esm/storage/1_storage_memory.d.ts +4 -4
- package/esm/storage/1_storage_memory.js +4 -2
- package/esm/storage/1_storage_session_storage.d.ts +3 -3
- package/esm/storage/1_storage_session_storage.js +13 -6
- package/esm/types/0_audio.d.ts +9 -0
- package/esm/types/0_chat_administrator_rights.d.ts +4 -4
- package/esm/types/0_contact.d.ts +6 -0
- package/esm/types/0_dice.d.ts +3 -0
- package/esm/types/0_force_reply.d.ts +1 -1
- package/esm/types/0_keyboard_button_poll_type.d.ts +1 -1
- package/esm/types/0_location.d.ts +7 -0
- package/esm/types/0_login_url.d.ts +3 -3
- package/esm/types/0_mask_position.d.ts +5 -0
- package/esm/types/0_message_entity.d.ts +4 -4
- package/esm/types/0_reply_keyboard_remove.d.ts +1 -1
- package/esm/types/0_thumbnail.d.ts +2 -1
- package/esm/types/0_venue.d.ts +6 -0
- package/esm/types/0_voice.d.ts +6 -0
- package/esm/types/1_animation.d.ts +10 -0
- package/esm/types/1_chat.d.ts +18 -18
- package/esm/types/1_document.d.ts +7 -0
- package/esm/types/1_inline_keyboard_button.d.ts +7 -7
- package/esm/types/1_keyboard_button.d.ts +14 -14
- package/esm/types/1_photo.d.ts +2 -1
- package/esm/types/1_sticker.d.ts +16 -0
- package/esm/types/1_user.d.ts +7 -7
- package/esm/types/1_video.d.ts +10 -0
- package/esm/types/1_video_note.d.ts +8 -0
- package/esm/types/2_game.d.ts +7 -0
- package/esm/types/2_reply_keyboard_markup.d.ts +5 -5
- package/esm/types/3_message.d.ts +57 -25
- package/esm/types/3_message.js +0 -1
- package/package.json +1 -1
- package/script/client/0_utilities.d.ts +3 -0
- package/script/client/0_utilities.js +48 -0
- package/script/client/3_client.d.ts +2 -2
- package/script/client/3_client.js +57 -16
- package/script/constants.d.ts +1 -1
- package/script/constants.js +1 -1
- package/script/storage/0_storage.d.ts +16 -17
- package/script/storage/0_storage.js +65 -131
- package/script/storage/0_utilities.d.ts +13 -0
- package/script/storage/0_utilities.js +68 -0
- package/script/storage/1_storage_indexed_db.d.ts +3 -3
- package/script/storage/1_storage_indexed_db.js +4 -3
- package/script/storage/1_storage_local_storage.d.ts +3 -3
- package/script/storage/1_storage_local_storage.js +13 -6
- package/script/storage/1_storage_memory.d.ts +4 -4
- package/script/storage/1_storage_memory.js +4 -2
- package/script/storage/1_storage_session_storage.d.ts +3 -3
- package/script/storage/1_storage_session_storage.js +13 -6
- package/script/types/0_audio.d.ts +9 -0
- package/script/types/0_chat_administrator_rights.d.ts +4 -4
- package/script/types/0_contact.d.ts +6 -0
- package/script/types/0_dice.d.ts +3 -0
- package/script/types/0_force_reply.d.ts +1 -1
- package/script/types/0_keyboard_button_poll_type.d.ts +1 -1
- package/script/types/0_location.d.ts +7 -0
- package/script/types/0_login_url.d.ts +3 -3
- package/script/types/0_mask_position.d.ts +5 -0
- package/script/types/0_message_entity.d.ts +4 -4
- package/script/types/0_reply_keyboard_remove.d.ts +1 -1
- package/script/types/0_thumbnail.d.ts +2 -1
- package/script/types/0_venue.d.ts +6 -0
- package/script/types/0_voice.d.ts +6 -0
- package/script/types/1_animation.d.ts +10 -0
- package/script/types/1_chat.d.ts +18 -18
- package/script/types/1_document.d.ts +7 -0
- package/script/types/1_inline_keyboard_button.d.ts +7 -7
- package/script/types/1_keyboard_button.d.ts +14 -14
- package/script/types/1_photo.d.ts +2 -1
- package/script/types/1_sticker.d.ts +16 -0
- package/script/types/1_user.d.ts +7 -7
- package/script/types/1_video.d.ts +10 -0
- package/script/types/1_video_note.d.ts +8 -0
- package/script/types/2_game.d.ts +7 -0
- package/script/types/2_reply_keyboard_markup.d.ts +5 -5
- package/script/types/3_message.d.ts +57 -25
- package/script/types/3_message.js +0 -1
|
@@ -24,105 +24,137 @@ import { Location } from "./0_location.js";
|
|
|
24
24
|
export interface Message {
|
|
25
25
|
/** Unique message identifier inside this chat */
|
|
26
26
|
id: number;
|
|
27
|
-
/**
|
|
27
|
+
/** Unique identifier of a message thread to which the message belongs; for supergroups only */
|
|
28
28
|
threadId?: number;
|
|
29
|
-
/**
|
|
29
|
+
/** Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
|
|
30
30
|
from?: User;
|
|
31
|
-
/**
|
|
31
|
+
/** Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
|
|
32
32
|
senderChat?: Chat;
|
|
33
33
|
/** Date the message was sent in Unix time */
|
|
34
34
|
date?: Date;
|
|
35
35
|
/** Conversation the message belongs to */
|
|
36
36
|
chat: Chat;
|
|
37
|
-
/**
|
|
37
|
+
/** For forwarded messages, sender of the original message */
|
|
38
38
|
forwardFrom?: User;
|
|
39
|
-
/**
|
|
39
|
+
/** For messages forwarded from channels or from anonymous administrators, information about the original sender chat */
|
|
40
40
|
forwardFromChat?: Chat;
|
|
41
|
-
/**
|
|
41
|
+
/** For messages forwarded from channels, identifier of the original message in the channel */
|
|
42
42
|
forwardId?: number;
|
|
43
|
-
/**
|
|
43
|
+
/** For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present */
|
|
44
44
|
forwardSignature?: string;
|
|
45
|
-
/**
|
|
45
|
+
/** Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages */
|
|
46
46
|
forwardSenderName?: string;
|
|
47
|
-
/**
|
|
47
|
+
/** For forwarded messages, date the original message was sent in Unix time */
|
|
48
48
|
forwardDate?: Date;
|
|
49
|
-
/**
|
|
49
|
+
/** True, if the message is sent to a forum topic */
|
|
50
50
|
isTopicMessage: boolean;
|
|
51
|
-
/**
|
|
51
|
+
/** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
|
|
52
52
|
isAutomaticForward?: boolean;
|
|
53
|
-
/**
|
|
53
|
+
/** For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */
|
|
54
54
|
replyToMessage?: Omit<Message, "replyToMessage">;
|
|
55
|
-
/**
|
|
55
|
+
/** Bot through which the message was sent */
|
|
56
56
|
viaBot?: User;
|
|
57
|
-
/**
|
|
57
|
+
/** Date the message was last edited in Unix time */
|
|
58
58
|
editDate?: Date;
|
|
59
|
-
/**
|
|
59
|
+
/** True, if the message can't be forwarded */
|
|
60
60
|
hasProtectedContent?: boolean;
|
|
61
|
-
/**
|
|
61
|
+
/** The unique identifier of a media message group this message belongs to */
|
|
62
62
|
mediaGroupId?: string;
|
|
63
|
-
/**
|
|
63
|
+
/** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
|
|
64
64
|
authorSignature?: string;
|
|
65
|
-
/**
|
|
65
|
+
/** For text messages, the actual UTF-8 text of the message */
|
|
66
66
|
text?: string;
|
|
67
|
-
/**
|
|
67
|
+
/** For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */
|
|
68
68
|
entities?: MessageEntity[];
|
|
69
|
-
/**
|
|
69
|
+
/** Caption for the animation, audio, document, photo, video or voice */
|
|
70
70
|
caption?: string;
|
|
71
|
-
/**
|
|
71
|
+
/** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */
|
|
72
72
|
captionEntities?: MessageEntity[];
|
|
73
|
-
/**
|
|
73
|
+
/** True, if the message media is covered by a spoiler animation */
|
|
74
74
|
hasMediaSpoiler?: boolean;
|
|
75
|
-
/**
|
|
75
|
+
/** View count for channel posts */
|
|
76
76
|
views?: number;
|
|
77
|
-
/**
|
|
77
|
+
/** Inline keyboard attached to the message. `login_url` buttons are represented as ordinary `url` buttons. */
|
|
78
78
|
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
79
|
-
/**
|
|
79
|
+
/** Message is a photo, available sizes of the photo */
|
|
80
80
|
photo?: Photo;
|
|
81
|
+
/** Message is a general file, information about the file */
|
|
81
82
|
document?: Document;
|
|
83
|
+
/** Message is a video, information about the video */
|
|
82
84
|
video?: Video;
|
|
85
|
+
/** Message is a sticker, information about the sticker */
|
|
83
86
|
sticker?: Sticker;
|
|
87
|
+
/** Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set */
|
|
84
88
|
animation?: Animation;
|
|
89
|
+
/** Message is a voice message, information about the file */
|
|
85
90
|
voice?: Voice;
|
|
91
|
+
/** Message is an audio file, information about the file */
|
|
86
92
|
audio?: Audio;
|
|
93
|
+
/** Message is a dice with random value */
|
|
87
94
|
dice?: Dice;
|
|
95
|
+
/** Message is a [video note](https://telegram.org/blog/video-messages-and-telescope), information about the video message */
|
|
88
96
|
videoNote?: VideoNote;
|
|
97
|
+
/** Message is a shared contact, information about the contact */
|
|
89
98
|
contact?: Contact;
|
|
99
|
+
/** Message is a game, information about the game. */
|
|
90
100
|
game?: Game;
|
|
101
|
+
/** Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */
|
|
91
102
|
venue?: Venue;
|
|
103
|
+
/** Message is a shared location, information about the location */
|
|
92
104
|
location?: Location;
|
|
105
|
+
/** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
|
|
93
106
|
newChatMembers?: User[];
|
|
107
|
+
/** A member was removed from the group, information about them (this member may be the bot itself) */
|
|
94
108
|
leftChatMember?: User;
|
|
109
|
+
/** A chat title was changed to this value */
|
|
95
110
|
newChatTitle?: string;
|
|
111
|
+
/** A chat photo was change to this value */
|
|
96
112
|
newChatPhoto?: Photo;
|
|
113
|
+
/** Service message: the chat photo was deleted */
|
|
97
114
|
deletedChatPhoto?: true;
|
|
115
|
+
/** Service message: the group has been created */
|
|
98
116
|
groupCreated?: true;
|
|
117
|
+
/** Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. */
|
|
99
118
|
supergroupCreated?: true;
|
|
119
|
+
/** Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */
|
|
100
120
|
channelCreated?: true;
|
|
121
|
+
/** The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
|
|
101
122
|
chatMigratedTo?: number;
|
|
123
|
+
/** The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
|
|
102
124
|
chatMigratedFrom?: number;
|
|
125
|
+
/** Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. */
|
|
103
126
|
pinnedMessage?: Message;
|
|
127
|
+
/** Service message: a user was shared with the bot */
|
|
104
128
|
userShared?: {
|
|
105
129
|
requestId: number;
|
|
106
130
|
userId: number;
|
|
107
131
|
};
|
|
132
|
+
/** Service message: the user allowed the bot added to the attachment menu to write messages */
|
|
108
133
|
writeAccessAllowed?: {
|
|
109
134
|
webAppName?: string;
|
|
110
135
|
};
|
|
136
|
+
/** Service message: forum topic created */
|
|
111
137
|
forumTopicCreated?: {
|
|
112
138
|
name: string;
|
|
113
139
|
iconColor: string;
|
|
114
140
|
iconCutsomEmojiId?: string;
|
|
115
141
|
};
|
|
142
|
+
/** Service message: forum topic edited */
|
|
116
143
|
forumTopicEdited?: {
|
|
117
144
|
name?: string;
|
|
118
145
|
iconCutsomEmojiId?: string;
|
|
119
146
|
};
|
|
147
|
+
/** Service message: forum topic closed */
|
|
120
148
|
forumTopicClosed?: Record<never, never>;
|
|
149
|
+
/** Service message: forum topic reopened */
|
|
121
150
|
forumTopicReopened?: Record<never, never>;
|
|
151
|
+
/** Service message: video chat scheduled */
|
|
122
152
|
videoChatScheduled?: {
|
|
123
153
|
startDate: Date;
|
|
124
154
|
};
|
|
155
|
+
/** Service message: video chat started */
|
|
125
156
|
videoChatStarted?: Record<never, never>;
|
|
157
|
+
/** Service message: video chat ended */
|
|
126
158
|
videoChatEnded?: {
|
|
127
159
|
duration: number;
|
|
128
160
|
};
|
|
@@ -407,7 +407,6 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
407
407
|
message.location = (0, _0_location_js_1.constructLocation)(message_.media);
|
|
408
408
|
}
|
|
409
409
|
else {
|
|
410
|
-
console.log(message_.media);
|
|
411
410
|
// not implemented
|
|
412
411
|
(0, _0_control_js_1.UNREACHABLE)();
|
|
413
412
|
}
|