1 | ;
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 |
|
5 | Object.defineProperty(exports, "__esModule", {
|
6 | value: true
|
7 | });
|
8 | exports["default"] = void 0;
|
9 |
|
10 | var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
11 |
|
12 | var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
13 |
|
14 | var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
15 |
|
16 | var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
17 |
|
18 | var _Model2 = _interopRequireDefault(require("@lskjs/db/Model"));
|
19 |
|
20 | var _includes = _interopRequireDefault(require("lodash/includes"));
|
21 |
|
22 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
23 |
|
24 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
25 |
|
26 | // https://raw.githubusercontent.com/KnorpelSenf/typegram/master/types.d.ts
|
27 | var BotsTelegramMessageModel = /*#__PURE__*/function (_Model) {
|
28 | (0, _inherits2["default"])(BotsTelegramMessageModel, _Model);
|
29 |
|
30 | var _super = _createSuper(BotsTelegramMessageModel);
|
31 |
|
32 | function BotsTelegramMessageModel() {
|
33 | (0, _classCallCheck2["default"])(this, BotsTelegramMessageModel);
|
34 | return _super.apply(this, arguments);
|
35 | }
|
36 |
|
37 | return BotsTelegramMessageModel;
|
38 | }(_Model2["default"]);
|
39 |
|
40 | exports["default"] = BotsTelegramMessageModel;
|
41 | BotsTelegramMessageModel.schema = {
|
42 | telegramUserId: {
|
43 | type: _Model2["default"].Types.ObjectId,
|
44 | ref: 'BotsTelegramUserModel'
|
45 | },
|
46 | botId: {
|
47 | type: 'String'
|
48 | },
|
49 | type: {
|
50 | type: 'String'
|
51 | },
|
52 |
|
53 | /** INTERFACE ServiceMessage */
|
54 |
|
55 | /** Unique message identifier inside this chat */
|
56 | message_id: {
|
57 | type: Number
|
58 | },
|
59 |
|
60 | /** Sender, empty for messages sent to channels */
|
61 | from: {
|
62 | type: Object
|
63 | },
|
64 |
|
65 | /** Date the message was sent in Unix time */
|
66 | date: {
|
67 | type: Number
|
68 | },
|
69 |
|
70 | /** Conversation the message belongs to */
|
71 | chat: {
|
72 | type: Object
|
73 | },
|
74 |
|
75 | /** ------------------------------ */
|
76 |
|
77 | /** INTERFACE CommonMessage extends ServiceMessage */
|
78 |
|
79 | /** For forwarded messages, sender of the original message */
|
80 | forward_from: {
|
81 | type: Object
|
82 | },
|
83 |
|
84 | /** For messages forwarded from channels, information about the original channel */
|
85 | forward_from_chat: {
|
86 | type: Object
|
87 | },
|
88 |
|
89 | /** For messages forwarded from channels, identifier of the original message in the channel */
|
90 | forward_from_message_id: {
|
91 | type: Number
|
92 | },
|
93 |
|
94 | /** For messages forwarded from channels, signature of the post author if present */
|
95 | forward_signature: {
|
96 | type: String
|
97 | },
|
98 |
|
99 | /** Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages */
|
100 | forward_sender_name: {
|
101 | type: String
|
102 | },
|
103 |
|
104 | /** For forwarded messages, date the original message was sent in Unix time */
|
105 | forward_date: {
|
106 | type: Number
|
107 | },
|
108 |
|
109 | /** 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. */
|
110 | reply_to_message: {
|
111 | type: Object
|
112 | },
|
113 |
|
114 | /** Bot through which the message was sent */
|
115 | via_bot: {
|
116 | type: Object
|
117 | },
|
118 |
|
119 | /** Date the message was last edited in Unix time */
|
120 | edit_date: {
|
121 | type: Number
|
122 | },
|
123 |
|
124 | /** Signature of the post author for messages in channels */
|
125 | author_signature: {
|
126 | type: String
|
127 | },
|
128 |
|
129 | /** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
|
130 | reply_markup: {
|
131 | type: Object
|
132 | },
|
133 |
|
134 | /** ------------------------------ */
|
135 |
|
136 | /** INTERFACE TextMessage extends CommonMessage */
|
137 |
|
138 | /** For text messages, the actual UTF-8 text of the message, 0-4096 characters */
|
139 | text: {
|
140 | type: String
|
141 | },
|
142 |
|
143 | /** For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */
|
144 | entities: {
|
145 | type: Object
|
146 | },
|
147 |
|
148 | /** ------------------------------ */
|
149 |
|
150 | /** INTERFACE CaptionableMessage extends CommonMessage */
|
151 |
|
152 | /** Caption for the animation, audio, document, photo, video or voice, 0-1024 characters */
|
153 | caption: {
|
154 | type: String
|
155 | },
|
156 |
|
157 | /** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */
|
158 | caption_entities: {
|
159 | type: Object // Array,
|
160 |
|
161 | },
|
162 |
|
163 | /** ------------------------------ */
|
164 |
|
165 | /** INTERFACE MediaMessage extends CaptionableMessage */
|
166 |
|
167 | /** The unique identifier of a media message group this message belongs to */
|
168 | media_group_id: {
|
169 | type: String
|
170 | },
|
171 |
|
172 | /** ------------------------------ */
|
173 |
|
174 | /** INTERFACE AudioMessage extends CaptionableMessage */
|
175 |
|
176 | /** Message is an audio file, information about the file */
|
177 | audio: {
|
178 | type: Object
|
179 | },
|
180 |
|
181 | /** ------------------------------ */
|
182 |
|
183 | /** INTERFACE DocumentMessage extends CaptionableMessage */
|
184 |
|
185 | /** Message is a general file, information about the file */
|
186 | document: {
|
187 | type: Object
|
188 | },
|
189 |
|
190 | /** ------------------------------ */
|
191 |
|
192 | /** INTERFACE AnimationMessage extends DocumentMessage */
|
193 |
|
194 | /** Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set */
|
195 | animation: {
|
196 | type: Object
|
197 | },
|
198 |
|
199 | /** ------------------------------ */
|
200 |
|
201 | /** INTERFACE PhotoMessage extends MediaMessage */
|
202 |
|
203 | /** Message is a photo, available sizes of the photo */
|
204 | photo: {
|
205 | type: Object // || Array, default: undefined
|
206 |
|
207 | },
|
208 |
|
209 | /** } */
|
210 |
|
211 | /** INTERFACE StickerMessage extends CommonMessage */
|
212 |
|
213 | /** Message is a sticker, information about the sticker */
|
214 | sticker: {
|
215 | type: Object
|
216 | },
|
217 |
|
218 | /** ------------------------------ */
|
219 |
|
220 | /** INTERFACE VideoMessage extends MediaMessage */
|
221 |
|
222 | /** Message is a video, information about the video */
|
223 | video: {
|
224 | type: Object
|
225 | },
|
226 |
|
227 | /** ------------------------------ */
|
228 |
|
229 | /** INTERFACE VideoNoteMessage extends CommonMessage */
|
230 |
|
231 | /** Message is a video note, information about the video message */
|
232 | video_note: {
|
233 | type: Object
|
234 | },
|
235 |
|
236 | /** ------------------------------ */
|
237 |
|
238 | /** INTERFACE VoiceMessage extends CaptionableMessage */
|
239 |
|
240 | /** Message is a voice message, information about the file */
|
241 | voice: {
|
242 | type: Object
|
243 | },
|
244 |
|
245 | /** ------------------------------ */
|
246 |
|
247 | /** INTERFACE ContactMessage extends CommonMessage */
|
248 |
|
249 | /** Message is a shared contact, information about the contact */
|
250 | contact: {
|
251 | type: Object
|
252 | },
|
253 |
|
254 | /** ------------------------------ */
|
255 |
|
256 | /** INTERFACE DiceMessage extends CommonMessage */
|
257 |
|
258 | /** Message is a dice with random value from 1 to 6 */
|
259 | dice: {
|
260 | type: Object
|
261 | },
|
262 |
|
263 | /** ------------------------------ */
|
264 |
|
265 | /** INTERFACE GameMessage extends CommonMessage */
|
266 |
|
267 | /** Message is a game, information about the game. More about games » */
|
268 | game: {
|
269 | type: Object
|
270 | },
|
271 |
|
272 | /** ------------------------------ */
|
273 |
|
274 | /** INTERFACE PollMessage extends CommonMessage */
|
275 |
|
276 | /** Message is a native poll, information about the poll */
|
277 | poll: {
|
278 | type: Object
|
279 | },
|
280 |
|
281 | /** ------------------------------ */
|
282 |
|
283 | /** INTERFACE LocationMessage extends CommonMessage */
|
284 |
|
285 | /** Message is a shared location, information about the location */
|
286 | location: {
|
287 | type: Object
|
288 | },
|
289 |
|
290 | /** ------------------------------ */
|
291 |
|
292 | /** INTERFACE VenueMessage extends LocationMessage */
|
293 |
|
294 | /** Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */
|
295 | venue: {
|
296 | type: Object
|
297 | },
|
298 |
|
299 | /** ------------------------------ */
|
300 |
|
301 | /** INTERFACE NewChatMembersMessage extends ServiceMessage */
|
302 |
|
303 | /** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
|
304 | new_chat_members: {
|
305 | type: Object // Array,
|
306 |
|
307 | },
|
308 |
|
309 | /** ------------------------------ */
|
310 |
|
311 | /** INTERFACE LeftChatMemberMessage extends ServiceMessage */
|
312 |
|
313 | /** A member was removed from the group, information about them (this member may be the bot itself) */
|
314 | left_chat_member: {
|
315 | type: Object
|
316 | },
|
317 |
|
318 | /** ------------------------------ */
|
319 |
|
320 | /** INTERFACE NewChatTitleMessage extends ServiceMessage */
|
321 |
|
322 | /** A chat title was changed to this value */
|
323 | new_chat_title: {
|
324 | type: String
|
325 | },
|
326 |
|
327 | /** ------------------------------ */
|
328 |
|
329 | /** INTERFACE NewChatPhotoMessage extends ServiceMessage */
|
330 |
|
331 | /** A chat photo was change to this value */
|
332 | new_chat_photo: {
|
333 | type: Object // Array,
|
334 |
|
335 | },
|
336 |
|
337 | /** ------------------------------ */
|
338 |
|
339 | /** INTERFACE DeleteChatPhotoMessage extends ServiceMessage */
|
340 |
|
341 | /** Service message: the chat photo was deleted */
|
342 | delete_chat_photo: {
|
343 | type: Boolean
|
344 | },
|
345 |
|
346 | /** ------------------------------ */
|
347 |
|
348 | /** INTERFACE GroupChatCreatedMessage extends ServiceMessage */
|
349 |
|
350 | /** Service message: the group has been created */
|
351 | group_chat_created: {
|
352 | type: Boolean
|
353 | },
|
354 |
|
355 | /** ------------------------------ */
|
356 |
|
357 | /** INTERFACE SupergroupChatCreated extends ServiceMessage */
|
358 |
|
359 | /** 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. */
|
360 | supergroup_chat_created: {
|
361 | type: Boolean
|
362 | },
|
363 |
|
364 | /** ------------------------------ */
|
365 |
|
366 | /** INTERFACE ChannelChatCreatedMessage extends ServiceMessage */
|
367 |
|
368 | /** 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. */
|
369 | channel_chat_created: {
|
370 | type: Boolean
|
371 | },
|
372 |
|
373 | /** ------------------------------ */
|
374 |
|
375 | /** INTERFACE MigrateToChatIdMessage extends ServiceMessage */
|
376 |
|
377 | /** The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. */
|
378 | migrate_to_chat_id: {
|
379 | type: Number
|
380 | },
|
381 |
|
382 | /** ------------------------------ */
|
383 |
|
384 | /** INTERFACE MigrateFromChatIdMessage extends ServiceMessage */
|
385 |
|
386 | /** The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. */
|
387 | migrate_from_chat_id: {
|
388 | type: Number
|
389 | },
|
390 |
|
391 | /** ------------------------------ */
|
392 |
|
393 | /** INTERFACE PinnedMessageMessage extends ServiceMessage */
|
394 |
|
395 | /** 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. */
|
396 | // pinned_message: Omit<Message, "reply_to_message">;
|
397 |
|
398 | /** ------------------------------ */
|
399 |
|
400 | /** INTERFACE InvoiceMessage extends ServiceMessage */
|
401 |
|
402 | /** Message is an invoice for a payment, information about the invoice. More about payments » */
|
403 | invoice: {
|
404 | type: Object
|
405 | },
|
406 |
|
407 | /** ------------------------------ */
|
408 |
|
409 | /** INTERFACE SuccessfulPaymentMessage extends ServiceMessage */
|
410 |
|
411 | /** Message is a service message about a successful payment, information about the payment. More about payments » */
|
412 | successful_payment: {
|
413 | type: Object
|
414 | },
|
415 |
|
416 | /** ------------------------------ */
|
417 |
|
418 | /** INTERFACE ConnectedWebsiteMessage extends ServiceMessage */
|
419 |
|
420 | /** The domain name of the website on which the user has logged in. More about Telegram Login » */
|
421 | connected_website: {
|
422 | type: String
|
423 | },
|
424 |
|
425 | /** ------------------------------ */
|
426 |
|
427 | /** INTERFACE PassportDataMessage extends ServiceMessage */
|
428 |
|
429 | /** Telegram Passport data */
|
430 | passport_data: {
|
431 | type: Object
|
432 | },
|
433 | // Объект, в котрый можно складировать мета-информацию
|
434 | meta: {
|
435 | type: Object
|
436 | }
|
437 | };
|
438 | BotsTelegramMessageModel.options = {
|
439 | model: 'BotsTelegramMessageModel',
|
440 | collection: 'bots_telegram_message',
|
441 | timestamps: true
|
442 | };
|
443 | //# sourceMappingURL=BotsTelegramMessageModel.js.map |
\ | No newline at end of file |