sroosh 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +8 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -23,13 +23,13 @@ After installation, you'll need to obtain an API ID and hash:
23
23
  Then run this code to send a message to yourself.
24
24
 
25
25
  ```javascript
26
- import { SrooshClient } from "sroosh";
27
- import { StringSession } from "sroosh/sessions";
28
- import readline from "readline";
26
+ const { SrooshClient } = require("sroosh");
27
+ const { StringSession } = require("sroosh/sessions");
28
+ const readline = require("readline");
29
29
 
30
30
  const apiId = 1030400;
31
31
  const apiHash = "6edb16cf88714a4e9a805e928c39c937";
32
- const stringSession = new StringSession(""); // fill this later with the value from session.save()
32
+ const stringSession = new StringSession("");
33
33
 
34
34
  const rl = readline.createInterface({
35
35
  input: process.stdin,
@@ -38,21 +38,21 @@ const rl = readline.createInterface({
38
38
 
39
39
  (async () => {
40
40
  console.log("Loading interactive example...");
41
- const client = new TelegramClient(stringSession, apiId, apiHash, {
41
+ const client = new SrooshClient(stringSession, apiId, apiHash, {
42
42
  connectionRetries: 5,
43
43
  });
44
44
  await client.start({
45
45
  phoneNumber: async () =>
46
46
  new Promise((resolve) =>
47
- rl.question("Please enter your number: ", resolve)
47
+ rl.question("Please enter your number: ", resolve),
48
48
  ),
49
49
  password: async () =>
50
50
  new Promise((resolve) =>
51
- rl.question("Please enter your password: ", resolve)
51
+ rl.question("Please enter your password: ", resolve),
52
52
  ),
53
53
  phoneCode: async () =>
54
54
  new Promise((resolve) =>
55
- rl.question("Please enter the code you received: ", resolve)
55
+ rl.question("Please enter the code you received: ", resolve),
56
56
  ),
57
57
  onError: (err) => console.log(err),
58
58
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sroosh",
3
- "version": "1.0.0",
3
+ "version": "1.0.01",
4
4
  "description": "NodeJS/Browser MTProto API Sroosh client library,",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",