瀏覽代碼

Update example

painor 4 年之前
父節點
當前提交
63685cb5bc
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      examples/main.js

+ 5 - 5
examples/main.js

@@ -1,13 +1,13 @@
-const { TelegramClient } = require('../gramjs')
+const { TelegramClient } = require('../gramjs');
+const { StringSession } = require('../gramjs').sessions;
 
 
 (async () => {
     console.log('Loading interactive example...')
     const sessionName = 'anon'
-    const apiId = -1
-    const apiHash = ''
-    const client = new TelegramClient(sessionName, apiId, apiHash)
+    const apiId = -1 // 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)
     await client.connect()
-
     console.log('You should now be connected.')
 })()