|
@@ -56,10 +56,10 @@ function codeCallback() {
|
|
|
|
|
|
const { TelegramClient } = gramjs
|
|
|
const { StringSession } = gramjs.session
|
|
|
-const apiId = // put your api id here
|
|
|
-const apiHash = // put your api hash here
|
|
|
+const apiId = // put your api id here [for example 123456789]
|
|
|
+const apiHash = // put your api hash here [for example '123456abcfghe']
|
|
|
|
|
|
-const client = new TelegramClient(new StringSession(''), apiId, apiHash)
|
|
|
+const client = new TelegramClient(new StringSession(''), apiId, apiHash) // you can pass a string session here from previous logins.
|
|
|
// If you want to run this example in the test servers uncomment this line
|
|
|
//client.session.setDC(2, '149.154.167.40', 80)
|
|
|
|
|
@@ -69,6 +69,9 @@ client.start({
|
|
|
code: codeCallback,
|
|
|
}).then(() => {
|
|
|
console.log('%c you should now be connected', 'color:#B54128')
|
|
|
+ console.log('%c your string session is ' + client.save(), 'color:#B54128')
|
|
|
+ console.log('%c you can save it to login with it next time', 'color:#B54128')
|
|
|
+
|
|
|
})
|
|
|
|
|
|
|