How to use the telegram.link.PROD_PRIMARY_DC function in telegram

To help you get started, we’ve selected a few telegram examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pmarrapese / tg-logsaver / lib / TelegramClient.js View on Github external
constructor(appId, hash, version, dataCenter, encryptedAuthKey) {
    this.appId = appId;
    this.hash = hash;
    this.version = version;

    if (dataCenter) {
      let dcPieces = dataCenter.split(':');
      this.dataCenter = {
        host: dcPieces[0],
        port: dcPieces.length > 1 ? dcPieces[1] : DEFAULT_DATACENTER_PORT
      };
    } else {
      this.dataCenter = tg.PROD_PRIMARY_DC;
    }

    if (encryptedAuthKey) {
      this.authKey = tg.retrieveAuthKey(new Buffer(encryptedAuthKey, 'hex'), hash);
    }
  }