{"action":"created","issue":{"url":"https://api.github.com/repos/zerobias/telegram-mtproto/issues/105","repository_url":"https://api.github.com/repos/zerobias/telegram-mtproto","labels_url":"https://api.github.com/repos/zerobias/telegram-mtproto/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/zerobias/telegram-mtproto/issues/105/comments","events_url":"https://api.github.com/repos/zerobias/telegram-mtproto/issues/105/events","html_url":"https://github.com/zerobias/telegram-mtproto/issues/105","id":263932115,"number":105,"title":"TypeError: MTProto is not a function","user":{"login":"dundas","id":627426,"avatar_url":"https://avatars3.githubusercontent.com/u/627426?v=4","gravatar_id":"","url":"https://api.github.com/users/dundas","html_url":"https://github.com/dundas","followers_url":"https://api.github.com/users/dundas/followers","following_url":"https://api.github.com/users/dundas/following{/other_user}","gists_url":"https://api.github.com/users/dundas/gists{/gist_id}","starred_url":"https://api.github.com/users/dundas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dundas/subscriptions","organizations_url":"https://api.github.com/users/dundas/orgs","repos_url":"https://api.github.com/users/dundas/repos","events_url":"https://api.github.com/users/dundas/events{/privacy}","received_events_url":"https://api.github.com/users/dundas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-09T15:17:10Z","updated_at":"2017-10-09T17:46:19Z","closed_at":null,"author_association":"NONE","body":"I'm using the sample code to get started, but I'm getting this error: \r\nconst client = MTProto({webogram: true, dev: true})\r\n               ^\r\nTypeError: MTProto is not a function\r\n    at Object.<anonymous>\r\n\r\nAnyone else see this getting started, or can point me in the right direction to figuring it out? \r\n\r\nHere's my code below: \r\n\r\n`const MTProto = require('telegram-mtproto')\r\nconst phone = {\r\n  num : '+9996620001',\r\n  code: '22222'\r\n}\r\n\r\nconst api = {\r\n  layer          : 57,\r\n  initConnection : 0x69796de9,\r\n  api_id         : 49631\r\n}\r\n\r\nconst server = {\r\n  dev: true //We will connect to the test server.\r\n}           //Any empty configurations fields can just not be specified\r\n\r\n\r\nconst client = new MTProto({ server, api })\r\n\r\nasync function connect(){\r\n  const { phone_code_hash } = await client('auth.sendCode', {\r\n    phone_number  : phone.num,\r\n    current_number: false,\r\n    api_id        : 49631,\r\n    api_hash      : 'fb050b8f6771e15bfda5df2409931569'\r\n  })\r\n  const { user } = await client('auth.signIn', {\r\n    phone_number   : phone.num,\r\n    phone_code_hash: phone_code_hash,\r\n    phone_code     : phone.code\r\n  })\r\n\r\n  console.log('signed as ', user)\r\n}\r\n\r\nconnect()\r\n`"},"comment":{"url":"https://api.github.com/repos/zerobias/telegram-mtproto/issues/comments/335231346","html_url":"https://github.com/zerobias/telegram-mtproto/issues/105#issuecomment-335231346","issue_url":"https://api.github.com/repos/zerobias/telegram-mtproto/issues/105","id":335231346,"user":{"login":"dundas","id":627426,"avatar_url":"https://avatars3.githubusercontent.com/u/627426?v=4","gravatar_id":"","url":"https://api.github.com/users/dundas","html_url":"https://github.com/dundas","followers_url":"https://api.github.com/users/dundas/followers","following_url":"https://api.github.com/users/dundas/following{/other_user}","gists_url":"https://api.github.com/users/dundas/gists{/gist_id}","starred_url":"https://api.github.com/users/dundas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dundas/subscriptions","organizations_url":"https://api.github.com/users/dundas/orgs","repos_url":"https://api.github.com/users/dundas/repos","events_url":"https://api.github.com/users/dundas/events{/privacy}","received_events_url":"https://api.github.com/users/dundas/received_events","type":"User","site_admin":false},"created_at":"2017-10-09T17:46:19Z","updated_at":"2017-10-09T17:46:19Z","author_association":"NONE","body":"Thanks! I think I had that in my package.json, but I'll try to update and see if that works!"}}
{"actor":{"display_login":"dundas"}}