teleproto 1.224.0 → 1.224.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Utils.js +6 -0
- package/Version.d.ts +1 -1
- package/Version.js +1 -1
- package/errors/RPCBaseErrors.d.ts +9 -0
- package/errors/RPCBaseErrors.js +14 -1
- package/errors/RPCErrorList.d.ts +7 -1
- package/errors/RPCErrorList.js +17 -1
- package/network/MTProtoSender.js +5 -0
- package/package.json +1 -1
package/Utils.js
CHANGED
|
@@ -920,6 +920,12 @@ function getInputMedia(media, { isPhoto = false, attributes = undefined, forceDo
|
|
|
920
920
|
correctAnswers: correctAnswers,
|
|
921
921
|
solution: media.results.solution,
|
|
922
922
|
solutionEntities: media.results.solutionEntities,
|
|
923
|
+
attachedMedia: media.attachedMedia
|
|
924
|
+
? getInputMedia(media.attachedMedia)
|
|
925
|
+
: undefined,
|
|
926
|
+
solutionMedia: media.results.solutionMedia
|
|
927
|
+
? getInputMedia(media.results.solutionMedia)
|
|
928
|
+
: undefined,
|
|
923
929
|
});
|
|
924
930
|
}
|
|
925
931
|
if (media instanceof tl_1.Api.Poll) {
|
package/Version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.224.
|
|
1
|
+
export declare const version = "1.224.1";
|
package/Version.js
CHANGED
|
@@ -65,6 +65,15 @@ export declare class FloodError extends RPCError {
|
|
|
65
65
|
code: number;
|
|
66
66
|
errorMessage: string;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* The account is frozen and cannot use this method.
|
|
70
|
+
* Clients should call help.getAppConfig to get freeze_since_date,
|
|
71
|
+
* freeze_until_date, and freeze_appeal_url.
|
|
72
|
+
*/
|
|
73
|
+
export declare class FrozenError extends RPCError {
|
|
74
|
+
code: number;
|
|
75
|
+
errorMessage: string;
|
|
76
|
+
}
|
|
68
77
|
/**
|
|
69
78
|
* An internal server error occurred while a request was being processed
|
|
70
79
|
* for example, there was a disruption while accessing a database or file
|
package/errors/RPCBaseErrors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimedOutError = exports.ServerError = exports.FloodError = exports.AuthKeyError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.BadRequestError = exports.InvalidDCError = exports.RPCError = void 0;
|
|
3
|
+
exports.TimedOutError = exports.ServerError = exports.FrozenError = exports.FloodError = exports.AuthKeyError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.BadRequestError = exports.InvalidDCError = exports.RPCError = void 0;
|
|
4
4
|
const ts_custom_error_1 = require("ts-custom-error");
|
|
5
5
|
class RPCError extends ts_custom_error_1.CustomError {
|
|
6
6
|
constructor(message, request, code) {
|
|
@@ -107,6 +107,19 @@ class FloodError extends RPCError {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
exports.FloodError = FloodError;
|
|
110
|
+
/**
|
|
111
|
+
* The account is frozen and cannot use this method.
|
|
112
|
+
* Clients should call help.getAppConfig to get freeze_since_date,
|
|
113
|
+
* freeze_until_date, and freeze_appeal_url.
|
|
114
|
+
*/
|
|
115
|
+
class FrozenError extends RPCError {
|
|
116
|
+
constructor() {
|
|
117
|
+
super(...arguments);
|
|
118
|
+
this.code = 420;
|
|
119
|
+
this.errorMessage = "FROZEN";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.FrozenError = FrozenError;
|
|
110
123
|
/**
|
|
111
124
|
* An internal server error occurred while a request was being processed
|
|
112
125
|
* for example, there was a disruption while accessing a database or file
|
package/errors/RPCErrorList.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvalidDCError, FloodError, BadRequestError } from "./RPCBaseErrors";
|
|
1
|
+
import { InvalidDCError, FloodError, FrozenError, BadRequestError } from "./RPCBaseErrors";
|
|
2
2
|
export declare class UserMigrateError extends InvalidDCError {
|
|
3
3
|
newDc: number;
|
|
4
4
|
constructor(args: any);
|
|
@@ -34,4 +34,10 @@ export declare class EmailUnconfirmedError extends BadRequestError {
|
|
|
34
34
|
export declare class MsgWaitError extends FloodError {
|
|
35
35
|
constructor(args: any);
|
|
36
36
|
}
|
|
37
|
+
export declare class FrozenMethodError extends FrozenError {
|
|
38
|
+
constructor(args: any);
|
|
39
|
+
}
|
|
40
|
+
export declare class FrozenParticipantError extends BadRequestError {
|
|
41
|
+
constructor(args: any);
|
|
42
|
+
}
|
|
37
43
|
export declare const rpcErrorRe: Map<RegExp, any>;
|
package/errors/RPCErrorList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rpcErrorRe = exports.MsgWaitError = exports.EmailUnconfirmedError = exports.NetworkMigrateError = exports.FileMigrateError = exports.FloodTestPhoneWaitError = exports.FloodWaitError = exports.SlowModeWaitError = exports.PhoneMigrateError = exports.UserMigrateError = void 0;
|
|
3
|
+
exports.rpcErrorRe = exports.FrozenParticipantError = exports.FrozenMethodError = exports.MsgWaitError = exports.EmailUnconfirmedError = exports.NetworkMigrateError = exports.FileMigrateError = exports.FloodTestPhoneWaitError = exports.FloodWaitError = exports.SlowModeWaitError = exports.PhoneMigrateError = exports.UserMigrateError = void 0;
|
|
4
4
|
const RPCBaseErrors_1 = require("./RPCBaseErrors");
|
|
5
5
|
class UserMigrateError extends RPCBaseErrors_1.InvalidDCError {
|
|
6
6
|
constructor(args) {
|
|
@@ -103,11 +103,27 @@ class MsgWaitError extends RPCBaseErrors_1.FloodError {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
exports.MsgWaitError = MsgWaitError;
|
|
106
|
+
class FrozenMethodError extends RPCBaseErrors_1.FrozenError {
|
|
107
|
+
constructor(args) {
|
|
108
|
+
super(`This method cannot be used by a frozen account${RPCBaseErrors_1.RPCError._fmtRequest(args.request)}`, args.request, 420);
|
|
109
|
+
this.message = `This method cannot be used by a frozen account${RPCBaseErrors_1.RPCError._fmtRequest(args.request)}`;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.FrozenMethodError = FrozenMethodError;
|
|
113
|
+
class FrozenParticipantError extends RPCBaseErrors_1.BadRequestError {
|
|
114
|
+
constructor(args) {
|
|
115
|
+
super(`This peer cannot be accessed by a frozen account${RPCBaseErrors_1.RPCError._fmtRequest(args.request)}`, args.request, 400);
|
|
116
|
+
this.message = `This peer cannot be accessed by a frozen account${RPCBaseErrors_1.RPCError._fmtRequest(args.request)}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.FrozenParticipantError = FrozenParticipantError;
|
|
106
120
|
exports.rpcErrorRe = new Map([
|
|
107
121
|
[/FILE_MIGRATE_(\d+)/, FileMigrateError],
|
|
108
122
|
[/FLOOD_TEST_PHONE_WAIT_(\d+)/, FloodTestPhoneWaitError],
|
|
109
123
|
[/FLOOD_WAIT_(\d+)/, FloodWaitError],
|
|
110
124
|
[/FLOOD_PREMIUM_WAIT_(\d+)/, FloodWaitError],
|
|
125
|
+
[/FROZEN_METHOD_INVALID/, FrozenMethodError],
|
|
126
|
+
[/FROZEN_PARTICIPANT_MISSING/, FrozenParticipantError],
|
|
111
127
|
[/MSG_WAIT_(.*)/, MsgWaitError],
|
|
112
128
|
[/PHONE_MIGRATE_(\d+)/, PhoneMigrateError],
|
|
113
129
|
[/SLOWMODE_WAIT_(\d+)/, SlowModeWaitError],
|
package/network/MTProtoSender.js
CHANGED
|
@@ -497,6 +497,11 @@ class MTProtoSender {
|
|
|
497
497
|
this._handleBadAuthKey(true);
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
+
else if (e instanceof errors_1.TypeNotFoundError) {
|
|
501
|
+
// Unknown constructor in an update (e.g. new TL objects not in our schema).
|
|
502
|
+
// Safe to skip — no reconnect needed.
|
|
503
|
+
this._log.info(`Unknown constructor ${e.invalidConstructorId} in update, skipping (remaining: ${e.remaining.length} bytes)`);
|
|
504
|
+
}
|
|
500
505
|
else {
|
|
501
506
|
this._log.error("Unhandled error while receiving data");
|
|
502
507
|
if (this._client._errorHandler) {
|