@@ -460,7 +460,7 @@ export class TelegramClient extends TelegramBaseClient {
} catch (e) {
// we can't create sender for our own main DC
if (e.message=="DC_ID_INVALID"){
- throw e;
+ return this._sender;
}
await sender.disconnect();
@@ -225,12 +225,14 @@ function compareType(value, type) {
let correct = true;
switch (type) {
case "number":
+ correct = typeof value === "number" || value===undefined;
+ break;
case "string":
case "boolean":
correct = typeof value === type;
break;
case "bigInt":
- correct = bigInt.isInstance(value);
+ correct = bigInt.isInstance(value) || value===undefined;
case "true":
// true value is always correct
@@ -1,12 +1,12 @@
{
"name": "telegram",
- "version": "1.7.0",
+ "version": "1.7.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"license": "MIT",
"dependencies": {
"@cryptography/aes": "^0.1.1",
@@ -1,6 +1,6 @@
"description": "NodeJS MTProto API Telegram client library,",
"main": "index.js",
"types": "index.d.ts",