1
0
Эх сурвалжийг харах

Merge branch 'master' of https://github.com/gram-js/gramjs

painor 3 жил өмнө
parent
commit
83bac9c858
2 өөрчлөгдсөн 31 нэмэгдсэн , 21 устгасан
  1. 21 21
      README.md
  2. 10 0
      gramjs/client/TelegramClient.ts

+ 21 - 21
README.md

@@ -1,38 +1,38 @@
 # GramJS
 
-**GramJS** is Telegram client implementation in Javascript. This project's _core_ is **completely based** on
-[Telethon](https://github.com/LonamiWebs/Telethon). All the files which are fully based on it.
-don't forget to have a look to the original project.
+A Telegram client written in JavaScript for Node.js and browsers, with its core being based on
+[Telethon](https://github.com/LonamiWebs/Telethon).
 
-### Obtaining your `API ID` and `Hash`
+### Obtaining your app ID and hash
 
-1. Follow [this link](https://my.telegram.org) and login with your phone number.
-2. Click under `API Development tools`.
-3. A `Create new application` window will appear. Fill in your application details.
-   There is no need to enter any `URL`, and only the first two fields (`App title` and `Short name`)
-   can be changed later as long as I'm aware.
-4. Click on `Create application` at the end. Now that you have the `API ID` and `Hash`
+1. Follow [this link](https://my.telegram.org), and login with your phone number.
+2. Click `API development tools`.
+3. Fill in your application details.
+   There is no need to enter any `URL`, and only the first two fields (app title and short name)
+   can be modified later.
+4. Finally, click "Create application".
 
 ## Running GramJS
 
-If you want to run in it in a browser just use webpack (a configuration file is already present).
-The output will be in `browser` folder.
-In the browser gramjs will use localstorage to not regenerate api methods each run.
-check the `examples` folder for more info.
+GramJS can run on Node.js, browsers and with frameworks like React.
 
-## Generate Session String
+In browsers, GramJS will be using the `localStorage` to cache the layers.
 
-To generate session string , simply run `npx tgsession` and provide required details
+To get a browser bundle of GramJS, use the following command:
 
-## Using raw api
+```bash
+NODE_ENV=development npx webpack
+```
 
-Currently you can use any raw api function using `await client.invoke(new RequestClass(args))` .
-you can find all the requests and types at https://gram.js.org/
+## Using the raw API
+
+Currently, you can call any raw API method like `await client.invoke(new RequestClass(args))` .
+You can find all methods and types at [gram.js.org](https://gram.js.org).
 
 ## Docs
 
-you can find the docs at https://painor.gitbook.io/gramjs/ or https://gram.js.org/ which has all the functions with a usage example
+Youu can find the docs at [painor.gitbook.io/gramjs](https://painor.gitbook.io/gramjs) visit [gram.js.org](https://gram.js.org) to see all supported API methods and types.
 
 ## Asking questions
 
-If you have any question about how to use the library feel free to open a github issue or join us at the telegram group [@GramJSChat](https://t.me/gramjschat)
+If you have any question about GramJS, feel free to open a issue or join us at the Telegram group, [@GramJSChat](https://t.me/gramjschat).

+ 10 - 0
gramjs/client/TelegramClient.ts

@@ -1169,6 +1169,16 @@ export class TelegramClient extends TelegramBaseClient {
         return userMethods.getPeerId(this, peer, addMark);
     }
 
+    /** @hidden */
+    _getInputDialog(peer: any) {
+        return userMethods._getInputDialog(this, peer);
+    }
+
+    /** @hidden */
+    _getInputNotify(notify: any) {
+        return userMethods._getInputNotify(this, notify);
+    }
+
     //endregion
 
     //region base methods