Skip to content

Commit

Permalink
Update version
Browse files Browse the repository at this point in the history
  • Loading branch information
painor committed Sep 21, 2024
1 parent dc59ce3 commit ab85b03
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gramjs/Version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "2.25.7";
export const version = "2.25.8";
2 changes: 1 addition & 1 deletion gramjs/client/telegramBaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export abstract class TelegramBaseClient {
}
this._connection = clientParams.connection;
let initProxy;
if (this._proxy && 'MTProxy' in this._proxy) {
if (this._proxy && "MTProxy" in this._proxy) {
this._connection = ConnectionTCPMTProxyAbridged;
initProxy = new Api.InputClientProxy({
address: this._proxy.ip,
Expand Down
7 changes: 5 additions & 2 deletions gramjs/extensions/PromisedNetSockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import * as net from "./net";
import { SocksClient } from "./socks";

import { Mutex } from "async-mutex";
import { ProxyInterface, SocksProxyType } from "../network/connection/TCPMTProxy";
import {
ProxyInterface,
SocksProxyType,
} from "../network/connection/TCPMTProxy";

const mutex = new Mutex();

Expand All @@ -22,7 +25,7 @@ export class PromisedNetSockets {
this.stream = Buffer.alloc(0);
if (proxy) {
// we only want to use this when it's not an MTProto proxy.
if (!('MTProxy' in proxy)) {
if (!("MTProxy" in proxy)) {
if (!proxy.ip || !proxy.port || !proxy.socksType) {
throw new Error(
`Invalid sockets params: ip=${proxy.ip}, port=${proxy.port}, socksType=${proxy.socksType}`
Expand Down
6 changes: 3 additions & 3 deletions gramjs/network/connection/TCPMTProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ interface BasicProxyInterface {
export type MTProxyType = BasicProxyInterface & {
secret: string;
MTProxy: true;
}
};
export type SocksProxyType = BasicProxyInterface & {
socksType: 4 | 5;
}
};

export type ProxyInterface = MTProxyType | SocksProxyType;

Expand Down Expand Up @@ -160,7 +160,7 @@ export class TCPMTProxy extends ObfuscatedConnection {
proxy: proxy,
testServers: testServers,
});
if (!('MTProxy' in proxy)) {
if (!("MTProxy" in proxy)) {
throw new Error("This connection only supports MPTProxies");
}
if (!proxy.secret) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "telegram",
"version": "2.25.7",
"version": "2.25.9",
"description": "NodeJS/Browser MTProto API Telegram client library,",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit ab85b03

Please sign in to comment.