@myronsi/messenger-api 2.1.0-alpha.46.next.165 → 2.1.0-alpha.47
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/CHANGELOG.md +16 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +472 -19
- package/dist/schema.d.ts +557 -21
- package/dist/ws-docs.json +34 -1
- package/dist/ws-events.d.ts +152 -9
- package/dist/ws-events.schema.json +574 -18
- package/package.json +1 -1
|
@@ -222,6 +222,8 @@
|
|
|
222
222
|
"stale_epoch",
|
|
223
223
|
"limit_reached",
|
|
224
224
|
"account_restricted",
|
|
225
|
+
"poll_closed",
|
|
226
|
+
"quiz_answered",
|
|
225
227
|
"internal_error"
|
|
226
228
|
]
|
|
227
229
|
},
|
|
@@ -2001,7 +2003,7 @@
|
|
|
2001
2003
|
},
|
|
2002
2004
|
"UploadPurpose": {
|
|
2003
2005
|
"type": "string",
|
|
2004
|
-
"description": "`sticker`: a PNG, JPEG or still WebP of at most 5 MB. The server fits it into 512 x 512 px with a transparent\nborder and stores a WebP (`413` when that is still over 512 KB). Only its uploader can load it until it is\nadded to a pack.\n\n`profile_music`: an audio file of at most 20 MB. The server keeps at most 30 s of it (from `start_ms` to\n`end_ms`, or the first 30 s), stored as AAC, reads the title and artist into `tags` and the embedded cover\ninto `thumbnail_url`. Use it with `PUT /me/music`.\n\n`profile_background`: an image (10 MB), an animated GIF (15 MB) or a video of at most 15 s (15 MB). Use it\nwith `PUT /me/background` or `PUT /groups/{chat_id}/background`.\n\n`emoji`: a PNG, JPEG, still WebP or GIF of at most 8 MB. The server scales it into 128 x 128 px (a GIF frame\nby frame) and refuses it with `413` when the result is still over 256 KB. Use it with\n`POST /emoji/packs/{pack_id}/emoji`.\n",
|
|
2006
|
+
"description": "`sticker`: a PNG, JPEG or still WebP of at most 5 MB. The server fits it into 512 x 512 px with a transparent\nborder and stores a WebP (`413` when that is still over 512 KB). Only its uploader can load it until it is\nadded to a pack.\n\nA sticker can also be made from a video (`kind: video`: MP4, WebM or MOV) or an animated GIF of at most 15 MB.\nThe server keeps at most 3 s of it (from `start_ms` to `end_ms`, or the first 3 s), crops it to the square\n`crop_x`, `crop_y`, `crop_size` when given (otherwise it fits the clip into the square with a transparent\nborder), drops the sound and stores a looping animated WebP of at most 512 x 512 px (`413` when it is still\nover 1 MB at the lowest quality). The sticker then has `is_animated: true`.\n\n`profile_music`: an audio file of at most 20 MB. The server keeps at most 30 s of it (from `start_ms` to\n`end_ms`, or the first 30 s), stored as AAC, reads the title and artist into `tags` and the embedded cover\ninto `thumbnail_url`. Use it with `PUT /me/music`.\n\n`profile_background`: an image (10 MB), an animated GIF (15 MB) or a video of at most 15 s (15 MB). Use it\nwith `PUT /me/background` or `PUT /groups/{chat_id}/background`.\n\n`emoji`: a PNG, JPEG, still WebP or GIF of at most 8 MB. The server scales it into 128 x 128 px (a GIF frame\nby frame) and refuses it with `413` when the result is still over 256 KB. Use it with\n`POST /emoji/packs/{pack_id}/emoji`.\n",
|
|
2005
2007
|
"enum": [
|
|
2006
2008
|
"message",
|
|
2007
2009
|
"avatar",
|
|
@@ -2046,12 +2048,30 @@
|
|
|
2046
2048
|
"start_ms": {
|
|
2047
2049
|
"type": "integer",
|
|
2048
2050
|
"minimum": 0,
|
|
2049
|
-
"description": "`profile_music`
|
|
2051
|
+
"description": "`profile_music`, and `sticker` from a video or GIF: where the kept part starts."
|
|
2050
2052
|
},
|
|
2051
2053
|
"end_ms": {
|
|
2052
2054
|
"type": "integer",
|
|
2053
2055
|
"minimum": 1,
|
|
2054
|
-
"description": "`profile_music
|
|
2056
|
+
"description": "`profile_music`: where the kept part ends, at most 30 s after `start_ms`. `sticker` from a video or GIF: at\nmost 3 s after `start_ms`.\n"
|
|
2057
|
+
},
|
|
2058
|
+
"crop_x": {
|
|
2059
|
+
"type": "number",
|
|
2060
|
+
"minimum": 0,
|
|
2061
|
+
"maximum": 1,
|
|
2062
|
+
"description": "`sticker` from a video or GIF: left edge of the square crop, as a fraction of the width."
|
|
2063
|
+
},
|
|
2064
|
+
"crop_y": {
|
|
2065
|
+
"type": "number",
|
|
2066
|
+
"minimum": 0,
|
|
2067
|
+
"maximum": 1,
|
|
2068
|
+
"description": "`sticker` from a video or GIF: top edge of the square crop, as a fraction of the height."
|
|
2069
|
+
},
|
|
2070
|
+
"crop_size": {
|
|
2071
|
+
"type": "number",
|
|
2072
|
+
"exclusiveMinimum": 0,
|
|
2073
|
+
"maximum": 1,
|
|
2074
|
+
"description": "`sticker` from a video or GIF: side of the square crop, as a fraction of the shorter side. Send all three\ncrop fields or none; the square must lie inside the frame.\n"
|
|
2055
2075
|
}
|
|
2056
2076
|
}
|
|
2057
2077
|
},
|
|
@@ -2506,17 +2526,21 @@
|
|
|
2506
2526
|
},
|
|
2507
2527
|
"MessageType": {
|
|
2508
2528
|
"type": "string",
|
|
2529
|
+
"description": "`poll`, `contact` and `location` carry their data in `Message.poll`, `Message.contact` and\n`Message.location`. For older clients their `content` holds a short plain-text summary: `📊 <question>`,\n`👤 @<username>`, or `📍 <place name> <OpenStreetMap link>`.\n",
|
|
2509
2530
|
"enum": [
|
|
2510
2531
|
"text",
|
|
2511
2532
|
"file",
|
|
2512
2533
|
"voice",
|
|
2513
2534
|
"system",
|
|
2514
|
-
"sticker"
|
|
2535
|
+
"sticker",
|
|
2536
|
+
"poll",
|
|
2537
|
+
"contact",
|
|
2538
|
+
"location"
|
|
2515
2539
|
]
|
|
2516
2540
|
},
|
|
2517
2541
|
"Sticker": {
|
|
2518
2542
|
"type": "object",
|
|
2519
|
-
"description": "One sticker of a pack. `image` is a WebP or PNG of at most 512 x 512 px with transparency, animated when\n`is_animated` is true; any signed-in user can load it. Clients show it without a bubble.\n",
|
|
2543
|
+
"description": "One sticker of a pack. `image` is a WebP or PNG of at most 512 x 512 px with transparency, animated when\n`is_animated` is true (also stickers made from a video or GIF); any signed-in user can load it. The `panel`\nvariant of an animated sticker is a still first frame. Clients show it without a bubble.\n",
|
|
2520
2544
|
"required": [
|
|
2521
2545
|
"id",
|
|
2522
2546
|
"pack_id",
|
|
@@ -3161,7 +3185,7 @@
|
|
|
3161
3185
|
"null"
|
|
3162
3186
|
],
|
|
3163
3187
|
"maxLength": 4096,
|
|
3164
|
-
"description": "Text, the caption of a file, or the
|
|
3188
|
+
"description": "Text, the caption of a file, the emoji of a sticker, or the plain-text summary of a poll, contact or\nlocation (see `MessageType`); `null` when deleted.\n"
|
|
3165
3189
|
},
|
|
3166
3190
|
"attachment": {
|
|
3167
3191
|
"oneOf": [
|
|
@@ -3274,6 +3298,350 @@
|
|
|
3274
3298
|
"mentions_all": {
|
|
3275
3299
|
"type": "boolean",
|
|
3276
3300
|
"description": "`true` when an owner or admin wrote `@all`; it mentions every member. Absent otherwise."
|
|
3301
|
+
},
|
|
3302
|
+
"poll": {
|
|
3303
|
+
"description": "The poll of a `poll` message as the requesting user sees it; absent for other types, when deleted and in chat-list previews.",
|
|
3304
|
+
"$ref": "#/$defs/Poll"
|
|
3305
|
+
},
|
|
3306
|
+
"contact": {
|
|
3307
|
+
"description": "The shared user of a `contact` message; absent for other types, when deleted and in chat-list previews.",
|
|
3308
|
+
"$ref": "#/$defs/ContactCard"
|
|
3309
|
+
},
|
|
3310
|
+
"location": {
|
|
3311
|
+
"description": "The place of a `location` message; absent for other types and when deleted.",
|
|
3312
|
+
"$ref": "#/$defs/MessageLocation"
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
},
|
|
3316
|
+
"PollCreate": {
|
|
3317
|
+
"type": "object",
|
|
3318
|
+
"description": "A new poll. Option texts are trimmed and must differ (ignoring case). `quiz` makes it a quiz: one correct\noption, one answer per voter that cannot be changed; it cannot be combined with `multiple_answers`.\n`close_at` closes the poll automatically, 5 minutes to 30 days from now.\n",
|
|
3319
|
+
"required": [
|
|
3320
|
+
"question",
|
|
3321
|
+
"options"
|
|
3322
|
+
],
|
|
3323
|
+
"additionalProperties": false,
|
|
3324
|
+
"properties": {
|
|
3325
|
+
"question": {
|
|
3326
|
+
"type": "string",
|
|
3327
|
+
"minLength": 1,
|
|
3328
|
+
"maxLength": 300
|
|
3329
|
+
},
|
|
3330
|
+
"options": {
|
|
3331
|
+
"type": "array",
|
|
3332
|
+
"minItems": 2,
|
|
3333
|
+
"maxItems": 10,
|
|
3334
|
+
"items": {
|
|
3335
|
+
"type": "string",
|
|
3336
|
+
"minLength": 1,
|
|
3337
|
+
"maxLength": 100
|
|
3338
|
+
}
|
|
3339
|
+
},
|
|
3340
|
+
"multiple_answers": {
|
|
3341
|
+
"type": "boolean",
|
|
3342
|
+
"default": false
|
|
3343
|
+
},
|
|
3344
|
+
"anonymous": {
|
|
3345
|
+
"type": "boolean",
|
|
3346
|
+
"default": true,
|
|
3347
|
+
"description": "`false` lets everyone who sees the results list who voted for what. Anonymous votes are still stored\nwith the voter, so each member votes once and can change the vote, but no one else sees them.\n"
|
|
3348
|
+
},
|
|
3349
|
+
"quiz": {
|
|
3350
|
+
"$ref": "#/$defs/PollQuizCreate"
|
|
3351
|
+
},
|
|
3352
|
+
"close_at": {
|
|
3353
|
+
"$ref": "#/$defs/Timestamp"
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
},
|
|
3357
|
+
"PollQuizCreate": {
|
|
3358
|
+
"type": "object",
|
|
3359
|
+
"required": [
|
|
3360
|
+
"correct_option"
|
|
3361
|
+
],
|
|
3362
|
+
"additionalProperties": false,
|
|
3363
|
+
"properties": {
|
|
3364
|
+
"correct_option": {
|
|
3365
|
+
"type": "integer",
|
|
3366
|
+
"minimum": 0,
|
|
3367
|
+
"maximum": 9,
|
|
3368
|
+
"description": "Index into `options`"
|
|
3369
|
+
},
|
|
3370
|
+
"explanation": {
|
|
3371
|
+
"type": "string",
|
|
3372
|
+
"minLength": 1,
|
|
3373
|
+
"maxLength": 200
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
},
|
|
3377
|
+
"Poll": {
|
|
3378
|
+
"type": "object",
|
|
3379
|
+
"description": "A poll as the requesting user sees it. Results (`voter_count`, `total_voters`, `is_correct`, `explanation`)\nare `null` or absent until that user voted, unless they created the poll or it is closed. A poll is closed\nwhen `closed_at` is set; clients also treat it as closed once `close_at` has passed.\n",
|
|
3380
|
+
"required": [
|
|
3381
|
+
"question",
|
|
3382
|
+
"options",
|
|
3383
|
+
"multiple_answers",
|
|
3384
|
+
"anonymous",
|
|
3385
|
+
"quiz",
|
|
3386
|
+
"explanation",
|
|
3387
|
+
"close_at",
|
|
3388
|
+
"closed_at",
|
|
3389
|
+
"total_voters",
|
|
3390
|
+
"my_votes",
|
|
3391
|
+
"can_close",
|
|
3392
|
+
"version"
|
|
3393
|
+
],
|
|
3394
|
+
"properties": {
|
|
3395
|
+
"question": {
|
|
3396
|
+
"type": "string"
|
|
3397
|
+
},
|
|
3398
|
+
"options": {
|
|
3399
|
+
"type": "array",
|
|
3400
|
+
"items": {
|
|
3401
|
+
"$ref": "#/$defs/PollOption"
|
|
3402
|
+
}
|
|
3403
|
+
},
|
|
3404
|
+
"multiple_answers": {
|
|
3405
|
+
"type": "boolean"
|
|
3406
|
+
},
|
|
3407
|
+
"anonymous": {
|
|
3408
|
+
"type": "boolean"
|
|
3409
|
+
},
|
|
3410
|
+
"quiz": {
|
|
3411
|
+
"type": "boolean"
|
|
3412
|
+
},
|
|
3413
|
+
"explanation": {
|
|
3414
|
+
"type": [
|
|
3415
|
+
"string",
|
|
3416
|
+
"null"
|
|
3417
|
+
],
|
|
3418
|
+
"description": "The explanation of a quiz once the user sees the results."
|
|
3419
|
+
},
|
|
3420
|
+
"close_at": {
|
|
3421
|
+
"oneOf": [
|
|
3422
|
+
{
|
|
3423
|
+
"$ref": "#/$defs/Timestamp"
|
|
3424
|
+
},
|
|
3425
|
+
{
|
|
3426
|
+
"type": "null"
|
|
3427
|
+
}
|
|
3428
|
+
]
|
|
3429
|
+
},
|
|
3430
|
+
"closed_at": {
|
|
3431
|
+
"oneOf": [
|
|
3432
|
+
{
|
|
3433
|
+
"$ref": "#/$defs/Timestamp"
|
|
3434
|
+
},
|
|
3435
|
+
{
|
|
3436
|
+
"type": "null"
|
|
3437
|
+
}
|
|
3438
|
+
]
|
|
3439
|
+
},
|
|
3440
|
+
"total_voters": {
|
|
3441
|
+
"type": [
|
|
3442
|
+
"integer",
|
|
3443
|
+
"null"
|
|
3444
|
+
],
|
|
3445
|
+
"minimum": 0,
|
|
3446
|
+
"description": "People who voted, each counted once even with several answers."
|
|
3447
|
+
},
|
|
3448
|
+
"my_votes": {
|
|
3449
|
+
"type": "array",
|
|
3450
|
+
"description": "Indexes of the options the user voted for; empty when they have not voted.",
|
|
3451
|
+
"items": {
|
|
3452
|
+
"type": "integer",
|
|
3453
|
+
"minimum": 0,
|
|
3454
|
+
"maximum": 9
|
|
3455
|
+
}
|
|
3456
|
+
},
|
|
3457
|
+
"can_close": {
|
|
3458
|
+
"type": "boolean",
|
|
3459
|
+
"description": "The user may close the poll now."
|
|
3460
|
+
},
|
|
3461
|
+
"version": {
|
|
3462
|
+
"type": "integer",
|
|
3463
|
+
"minimum": 0,
|
|
3464
|
+
"description": "Grows with every vote and when the poll closes; keep the poll with the highest version."
|
|
3465
|
+
}
|
|
3466
|
+
}
|
|
3467
|
+
},
|
|
3468
|
+
"PollOption": {
|
|
3469
|
+
"type": "object",
|
|
3470
|
+
"required": [
|
|
3471
|
+
"text",
|
|
3472
|
+
"voter_count"
|
|
3473
|
+
],
|
|
3474
|
+
"properties": {
|
|
3475
|
+
"text": {
|
|
3476
|
+
"type": "string"
|
|
3477
|
+
},
|
|
3478
|
+
"voter_count": {
|
|
3479
|
+
"type": [
|
|
3480
|
+
"integer",
|
|
3481
|
+
"null"
|
|
3482
|
+
],
|
|
3483
|
+
"minimum": 0
|
|
3484
|
+
},
|
|
3485
|
+
"is_correct": {
|
|
3486
|
+
"type": "boolean",
|
|
3487
|
+
"description": "Set on every option of a quiz once the user sees the results; absent otherwise."
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
},
|
|
3491
|
+
"PollVoteRequest": {
|
|
3492
|
+
"type": "object",
|
|
3493
|
+
"required": [
|
|
3494
|
+
"options"
|
|
3495
|
+
],
|
|
3496
|
+
"additionalProperties": false,
|
|
3497
|
+
"properties": {
|
|
3498
|
+
"options": {
|
|
3499
|
+
"type": "array",
|
|
3500
|
+
"maxItems": 10,
|
|
3501
|
+
"uniqueItems": true,
|
|
3502
|
+
"items": {
|
|
3503
|
+
"type": "integer",
|
|
3504
|
+
"minimum": 0,
|
|
3505
|
+
"maximum": 9
|
|
3506
|
+
}
|
|
3507
|
+
}
|
|
3508
|
+
}
|
|
3509
|
+
},
|
|
3510
|
+
"ContactCreate": {
|
|
3511
|
+
"type": "object",
|
|
3512
|
+
"required": [
|
|
3513
|
+
"user_id"
|
|
3514
|
+
],
|
|
3515
|
+
"additionalProperties": false,
|
|
3516
|
+
"properties": {
|
|
3517
|
+
"user_id": {
|
|
3518
|
+
"description": "A user whose profile the sender may open (`403` otherwise), the sender included; not a deleted account.\n",
|
|
3519
|
+
"allOf": [
|
|
3520
|
+
{
|
|
3521
|
+
"$ref": "#/$defs/Id"
|
|
3522
|
+
}
|
|
3523
|
+
]
|
|
3524
|
+
}
|
|
3525
|
+
}
|
|
3526
|
+
},
|
|
3527
|
+
"ContactCard": {
|
|
3528
|
+
"type": "object",
|
|
3529
|
+
"required": [
|
|
3530
|
+
"user_id",
|
|
3531
|
+
"user"
|
|
3532
|
+
],
|
|
3533
|
+
"properties": {
|
|
3534
|
+
"user_id": {
|
|
3535
|
+
"$ref": "#/$defs/Id"
|
|
3536
|
+
},
|
|
3537
|
+
"user": {
|
|
3538
|
+
"description": "The shared user as the requesting user may see them now, not as they were when the card was sent; `null`\nwhen the account is gone.\n",
|
|
3539
|
+
"oneOf": [
|
|
3540
|
+
{
|
|
3541
|
+
"$ref": "#/$defs/User"
|
|
3542
|
+
},
|
|
3543
|
+
{
|
|
3544
|
+
"type": "null"
|
|
3545
|
+
}
|
|
3546
|
+
]
|
|
3547
|
+
}
|
|
3548
|
+
}
|
|
3549
|
+
},
|
|
3550
|
+
"LocationCreate": {
|
|
3551
|
+
"type": "object",
|
|
3552
|
+
"required": [
|
|
3553
|
+
"latitude",
|
|
3554
|
+
"longitude"
|
|
3555
|
+
],
|
|
3556
|
+
"additionalProperties": false,
|
|
3557
|
+
"properties": {
|
|
3558
|
+
"latitude": {
|
|
3559
|
+
"type": "number",
|
|
3560
|
+
"format": "double",
|
|
3561
|
+
"minimum": -90,
|
|
3562
|
+
"maximum": 90
|
|
3563
|
+
},
|
|
3564
|
+
"longitude": {
|
|
3565
|
+
"type": "number",
|
|
3566
|
+
"format": "double",
|
|
3567
|
+
"minimum": -180,
|
|
3568
|
+
"maximum": 180
|
|
3569
|
+
},
|
|
3570
|
+
"accuracy_m": {
|
|
3571
|
+
"type": "integer",
|
|
3572
|
+
"minimum": 0,
|
|
3573
|
+
"maximum": 10000,
|
|
3574
|
+
"description": "Accuracy of a measured position in metres; omit for a point picked on the map."
|
|
3575
|
+
},
|
|
3576
|
+
"title": {
|
|
3577
|
+
"type": "string",
|
|
3578
|
+
"minLength": 1,
|
|
3579
|
+
"maxLength": 100,
|
|
3580
|
+
"description": "A name for the place, typed by the sender."
|
|
3581
|
+
}
|
|
3582
|
+
}
|
|
3583
|
+
},
|
|
3584
|
+
"MessageLocation": {
|
|
3585
|
+
"type": "object",
|
|
3586
|
+
"description": "Coordinates are rounded to 6 decimals (about 10 cm).",
|
|
3587
|
+
"required": [
|
|
3588
|
+
"latitude",
|
|
3589
|
+
"longitude",
|
|
3590
|
+
"accuracy_m",
|
|
3591
|
+
"title",
|
|
3592
|
+
"map"
|
|
3593
|
+
],
|
|
3594
|
+
"properties": {
|
|
3595
|
+
"latitude": {
|
|
3596
|
+
"type": "number",
|
|
3597
|
+
"format": "double",
|
|
3598
|
+
"minimum": -90,
|
|
3599
|
+
"maximum": 90
|
|
3600
|
+
},
|
|
3601
|
+
"longitude": {
|
|
3602
|
+
"type": "number",
|
|
3603
|
+
"format": "double",
|
|
3604
|
+
"minimum": -180,
|
|
3605
|
+
"maximum": 180
|
|
3606
|
+
},
|
|
3607
|
+
"accuracy_m": {
|
|
3608
|
+
"type": [
|
|
3609
|
+
"integer",
|
|
3610
|
+
"null"
|
|
3611
|
+
],
|
|
3612
|
+
"minimum": 0
|
|
3613
|
+
},
|
|
3614
|
+
"title": {
|
|
3615
|
+
"type": [
|
|
3616
|
+
"string",
|
|
3617
|
+
"null"
|
|
3618
|
+
],
|
|
3619
|
+
"maxLength": 100
|
|
3620
|
+
},
|
|
3621
|
+
"map": {
|
|
3622
|
+
"$ref": "#/$defs/MapImage"
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
},
|
|
3626
|
+
"MapImage": {
|
|
3627
|
+
"type": "object",
|
|
3628
|
+
"required": [
|
|
3629
|
+
"url",
|
|
3630
|
+
"width",
|
|
3631
|
+
"height"
|
|
3632
|
+
],
|
|
3633
|
+
"properties": {
|
|
3634
|
+
"url": {
|
|
3635
|
+
"type": "string",
|
|
3636
|
+
"description": "`GET /maps/static` with the signed point; load it like other API images"
|
|
3637
|
+
},
|
|
3638
|
+
"width": {
|
|
3639
|
+
"type": "integer",
|
|
3640
|
+
"minimum": 1
|
|
3641
|
+
},
|
|
3642
|
+
"height": {
|
|
3643
|
+
"type": "integer",
|
|
3644
|
+
"minimum": 1
|
|
3277
3645
|
}
|
|
3278
3646
|
}
|
|
3279
3647
|
},
|
|
@@ -3365,12 +3733,15 @@
|
|
|
3365
3733
|
"message_unpinned",
|
|
3366
3734
|
"history_imported",
|
|
3367
3735
|
"history_import_ended",
|
|
3368
|
-
"imported_note"
|
|
3736
|
+
"imported_note",
|
|
3737
|
+
"group_renamed",
|
|
3738
|
+
"group_avatar_changed",
|
|
3739
|
+
"owner_transferred"
|
|
3369
3740
|
]
|
|
3370
3741
|
},
|
|
3371
3742
|
"SystemEvent": {
|
|
3372
3743
|
"type": "object",
|
|
3373
|
-
"description": "What a `system` message records; set on system messages only, whose `content` is then `null`. The names\nare the display names at the time of the event. `target` fields are set for `member_added` and
|
|
3744
|
+
"description": "What a `system` message records; set on system messages only, whose `content` is then `null`. The names\nare the display names at the time of the event. `target` fields are set for `member_added`,\n`member_removed` and `owner_transferred` (the new owner; `actor` is the previous one). `call` is set for\n`call` messages: one per call, posted when the call ends, `actor` is the initiator. `message_id` and\n`snippet` are set for `message_pinned` and `message_unpinned`. `old_name` and `new_name` are set for\n`group_renamed`, `avatar_removed` for `group_avatar_changed`.\n`history_imported` opens and `history_import_ended` closes an imported history; both carry `import`, and\n`actor` is the importer. `imported_note` is a line of the export that is not a message; its text is `text`.\n",
|
|
3374
3745
|
"required": [
|
|
3375
3746
|
"kind",
|
|
3376
3747
|
"actor_id",
|
|
@@ -3413,11 +3784,23 @@
|
|
|
3413
3784
|
"snippet": {
|
|
3414
3785
|
"type": "string",
|
|
3415
3786
|
"maxLength": 64,
|
|
3416
|
-
"description": "Start of the pinned message's text at the time of the event (at most 60 characters plus `…`)
|
|
3787
|
+
"description": "Start of the pinned message's text at the time of the event (at most 60 characters plus `…`): the question\nof a poll, the place name of a location. Empty for a message without text and for a contact, which clients\nname by its `message_type`.\n"
|
|
3417
3788
|
},
|
|
3418
3789
|
"message_type": {
|
|
3419
3790
|
"$ref": "#/$defs/MessageType"
|
|
3420
3791
|
},
|
|
3792
|
+
"old_name": {
|
|
3793
|
+
"type": "string",
|
|
3794
|
+
"maxLength": 64
|
|
3795
|
+
},
|
|
3796
|
+
"new_name": {
|
|
3797
|
+
"type": "string",
|
|
3798
|
+
"maxLength": 64
|
|
3799
|
+
},
|
|
3800
|
+
"avatar_removed": {
|
|
3801
|
+
"type": "boolean",
|
|
3802
|
+
"description": "`true` when the group photo was removed, `false` when a new one was set."
|
|
3803
|
+
},
|
|
3421
3804
|
"import": {
|
|
3422
3805
|
"$ref": "#/$defs/ImportSummary"
|
|
3423
3806
|
},
|
|
@@ -3511,7 +3894,10 @@
|
|
|
3511
3894
|
"text",
|
|
3512
3895
|
"file",
|
|
3513
3896
|
"voice",
|
|
3514
|
-
"sticker"
|
|
3897
|
+
"sticker",
|
|
3898
|
+
"poll",
|
|
3899
|
+
"contact",
|
|
3900
|
+
"location"
|
|
3515
3901
|
]
|
|
3516
3902
|
},
|
|
3517
3903
|
"content": {
|
|
@@ -3540,6 +3926,18 @@
|
|
|
3540
3926
|
"sticker": {
|
|
3541
3927
|
"$ref": "#/$defs/Sticker"
|
|
3542
3928
|
},
|
|
3929
|
+
"poll": {
|
|
3930
|
+
"description": "The poll of an unsent `poll` message, as it was sent.",
|
|
3931
|
+
"$ref": "#/$defs/PollCreate"
|
|
3932
|
+
},
|
|
3933
|
+
"contact": {
|
|
3934
|
+
"description": "The contact of an unsent `contact` message, as it was sent.",
|
|
3935
|
+
"$ref": "#/$defs/ContactCreate"
|
|
3936
|
+
},
|
|
3937
|
+
"location": {
|
|
3938
|
+
"description": "The place of an unsent `location` message, as it was sent.",
|
|
3939
|
+
"$ref": "#/$defs/LocationCreate"
|
|
3940
|
+
},
|
|
3543
3941
|
"error_code": {
|
|
3544
3942
|
"$ref": "#/$defs/ErrorCode"
|
|
3545
3943
|
},
|
|
@@ -3582,7 +3980,10 @@
|
|
|
3582
3980
|
"text",
|
|
3583
3981
|
"file",
|
|
3584
3982
|
"voice",
|
|
3585
|
-
"sticker"
|
|
3983
|
+
"sticker",
|
|
3984
|
+
"poll",
|
|
3985
|
+
"contact",
|
|
3986
|
+
"location"
|
|
3586
3987
|
]
|
|
3587
3988
|
},
|
|
3588
3989
|
"content": {
|
|
@@ -3592,6 +3993,18 @@
|
|
|
3592
3993
|
],
|
|
3593
3994
|
"maxLength": 4096
|
|
3594
3995
|
},
|
|
3996
|
+
"poll": {
|
|
3997
|
+
"description": "The poll of a `poll` message. Poll, contact and location messages have no content, attachment, sticker or\ndrawings; the server writes a plain-text summary into `content` for older clients. Send them with this\noperation; the WebSocket `message` event does not take them.\n",
|
|
3998
|
+
"$ref": "#/$defs/PollCreate"
|
|
3999
|
+
},
|
|
4000
|
+
"contact": {
|
|
4001
|
+
"description": "The shared user of a `contact` message.",
|
|
4002
|
+
"$ref": "#/$defs/ContactCreate"
|
|
4003
|
+
},
|
|
4004
|
+
"location": {
|
|
4005
|
+
"description": "The place of a `location` message.",
|
|
4006
|
+
"$ref": "#/$defs/LocationCreate"
|
|
4007
|
+
},
|
|
3595
4008
|
"sticker_id": {
|
|
3596
4009
|
"description": "The sticker of a `sticker` message, from any pack that is not deleted. Sticker messages have no content,\nattachment or drawings; the server sets `content` to the sticker's emoji. Send stickers with this\noperation; the WebSocket `message` event does not take them.\n",
|
|
3597
4010
|
"$ref": "#/$defs/Id"
|
|
@@ -3636,6 +4049,86 @@
|
|
|
3636
4049
|
}
|
|
3637
4050
|
}
|
|
3638
4051
|
},
|
|
4052
|
+
"allOf": [
|
|
4053
|
+
{
|
|
4054
|
+
"if": {
|
|
4055
|
+
"properties": {
|
|
4056
|
+
"type": {
|
|
4057
|
+
"const": "poll"
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
},
|
|
4061
|
+
"then": {
|
|
4062
|
+
"required": [
|
|
4063
|
+
"poll"
|
|
4064
|
+
],
|
|
4065
|
+
"properties": {
|
|
4066
|
+
"poll": {
|
|
4067
|
+
"$ref": "#/$defs/PollCreate"
|
|
4068
|
+
}
|
|
4069
|
+
}
|
|
4070
|
+
},
|
|
4071
|
+
"else": {
|
|
4072
|
+
"properties": {
|
|
4073
|
+
"poll": {
|
|
4074
|
+
"not": {}
|
|
4075
|
+
}
|
|
4076
|
+
}
|
|
4077
|
+
}
|
|
4078
|
+
},
|
|
4079
|
+
{
|
|
4080
|
+
"if": {
|
|
4081
|
+
"properties": {
|
|
4082
|
+
"type": {
|
|
4083
|
+
"const": "contact"
|
|
4084
|
+
}
|
|
4085
|
+
}
|
|
4086
|
+
},
|
|
4087
|
+
"then": {
|
|
4088
|
+
"required": [
|
|
4089
|
+
"contact"
|
|
4090
|
+
],
|
|
4091
|
+
"properties": {
|
|
4092
|
+
"contact": {
|
|
4093
|
+
"$ref": "#/$defs/ContactCreate"
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
},
|
|
4097
|
+
"else": {
|
|
4098
|
+
"properties": {
|
|
4099
|
+
"contact": {
|
|
4100
|
+
"not": {}
|
|
4101
|
+
}
|
|
4102
|
+
}
|
|
4103
|
+
}
|
|
4104
|
+
},
|
|
4105
|
+
{
|
|
4106
|
+
"if": {
|
|
4107
|
+
"properties": {
|
|
4108
|
+
"type": {
|
|
4109
|
+
"const": "location"
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
},
|
|
4113
|
+
"then": {
|
|
4114
|
+
"required": [
|
|
4115
|
+
"location"
|
|
4116
|
+
],
|
|
4117
|
+
"properties": {
|
|
4118
|
+
"location": {
|
|
4119
|
+
"$ref": "#/$defs/LocationCreate"
|
|
4120
|
+
}
|
|
4121
|
+
}
|
|
4122
|
+
},
|
|
4123
|
+
"else": {
|
|
4124
|
+
"properties": {
|
|
4125
|
+
"location": {
|
|
4126
|
+
"not": {}
|
|
4127
|
+
}
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4130
|
+
}
|
|
4131
|
+
],
|
|
3639
4132
|
"if": {
|
|
3640
4133
|
"properties": {
|
|
3641
4134
|
"type": {
|
|
@@ -3688,18 +4181,17 @@
|
|
|
3688
4181
|
"if": {
|
|
3689
4182
|
"properties": {
|
|
3690
4183
|
"type": {
|
|
3691
|
-
"
|
|
4184
|
+
"enum": [
|
|
4185
|
+
"sticker",
|
|
4186
|
+
"poll",
|
|
4187
|
+
"contact",
|
|
4188
|
+
"location"
|
|
4189
|
+
]
|
|
3692
4190
|
}
|
|
3693
4191
|
}
|
|
3694
4192
|
},
|
|
3695
4193
|
"then": {
|
|
3696
|
-
"required": [
|
|
3697
|
-
"sticker_id"
|
|
3698
|
-
],
|
|
3699
4194
|
"properties": {
|
|
3700
|
-
"sticker_id": {
|
|
3701
|
-
"$ref": "#/$defs/Id"
|
|
3702
|
-
},
|
|
3703
4195
|
"content": {
|
|
3704
4196
|
"not": {}
|
|
3705
4197
|
},
|
|
@@ -3712,6 +4204,30 @@
|
|
|
3712
4204
|
"drawings": {
|
|
3713
4205
|
"not": {}
|
|
3714
4206
|
}
|
|
4207
|
+
},
|
|
4208
|
+
"if": {
|
|
4209
|
+
"properties": {
|
|
4210
|
+
"type": {
|
|
4211
|
+
"const": "sticker"
|
|
4212
|
+
}
|
|
4213
|
+
}
|
|
4214
|
+
},
|
|
4215
|
+
"then": {
|
|
4216
|
+
"required": [
|
|
4217
|
+
"sticker_id"
|
|
4218
|
+
],
|
|
4219
|
+
"properties": {
|
|
4220
|
+
"sticker_id": {
|
|
4221
|
+
"$ref": "#/$defs/Id"
|
|
4222
|
+
}
|
|
4223
|
+
}
|
|
4224
|
+
},
|
|
4225
|
+
"else": {
|
|
4226
|
+
"properties": {
|
|
4227
|
+
"sticker_id": {
|
|
4228
|
+
"not": {}
|
|
4229
|
+
}
|
|
4230
|
+
}
|
|
3715
4231
|
}
|
|
3716
4232
|
},
|
|
3717
4233
|
"else": {
|
|
@@ -7499,6 +8015,43 @@
|
|
|
7499
8015
|
"data"
|
|
7500
8016
|
]
|
|
7501
8017
|
},
|
|
8018
|
+
"ServerPollUpdatedEvent": {
|
|
8019
|
+
"title": "ServerPollUpdatedEvent",
|
|
8020
|
+
"description": "Someone voted, changed or took back a vote, or the poll closed. Goes to every member of the chat, each with the poll as they see it (results only after they voted, for the creator, or once closed). Replace Message.poll when version is higher than the one you have.",
|
|
8021
|
+
"type": "object",
|
|
8022
|
+
"properties": {
|
|
8023
|
+
"type": {
|
|
8024
|
+
"const": "poll_updated"
|
|
8025
|
+
},
|
|
8026
|
+
"event_id": {
|
|
8027
|
+
"$ref": "#/$defs/Id"
|
|
8028
|
+
},
|
|
8029
|
+
"chat_id": {
|
|
8030
|
+
"$ref": "#/$defs/Id"
|
|
8031
|
+
},
|
|
8032
|
+
"data": {
|
|
8033
|
+
"type": "object",
|
|
8034
|
+
"properties": {
|
|
8035
|
+
"message_id": {
|
|
8036
|
+
"$ref": "#/$defs/Id"
|
|
8037
|
+
},
|
|
8038
|
+
"poll": {
|
|
8039
|
+
"$ref": "#/$defs/Poll"
|
|
8040
|
+
}
|
|
8041
|
+
},
|
|
8042
|
+
"required": [
|
|
8043
|
+
"message_id",
|
|
8044
|
+
"poll"
|
|
8045
|
+
]
|
|
8046
|
+
}
|
|
8047
|
+
},
|
|
8048
|
+
"required": [
|
|
8049
|
+
"type",
|
|
8050
|
+
"event_id",
|
|
8051
|
+
"chat_id",
|
|
8052
|
+
"data"
|
|
8053
|
+
]
|
|
8054
|
+
},
|
|
7502
8055
|
"ServerPresenceEvent": {
|
|
7503
8056
|
"title": "ServerPresenceEvent",
|
|
7504
8057
|
"description": "A user came online or went offline, as far as their privacy settings allow.",
|
|
@@ -8031,6 +8584,9 @@
|
|
|
8031
8584
|
{
|
|
8032
8585
|
"$ref": "#/$defs/ServerPinUpdateEvent"
|
|
8033
8586
|
},
|
|
8587
|
+
{
|
|
8588
|
+
"$ref": "#/$defs/ServerPollUpdatedEvent"
|
|
8589
|
+
},
|
|
8034
8590
|
{
|
|
8035
8591
|
"$ref": "#/$defs/ServerPresenceEvent"
|
|
8036
8592
|
},
|