Comparing version 1.1.9-rc.1 to 1.1.9-rc.2
{ | ||
"name": "puregram", | ||
"version": "1.1.9-rc.1", | ||
"version": "1.1.9-rc.2", | ||
"main": "src/index.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -6,3 +6,3 @@ # puregram | ||
## Installation | ||
> **[Node.js](https://nodejs.org/) 8.0.0 or newer is required** | ||
> **[Node.js](https://nodejs.org/) 8.0.0 or newer is required** | ||
@@ -24,3 +24,3 @@ ### Yarn | ||
let telegram = new Telegram({ | ||
token: process.env.TOKEN, | ||
token: process.env.TOKEN | ||
}); | ||
@@ -31,3 +31,3 @@ | ||
telegram.updates.startPolling().then( | ||
() => console.log('Started polling') | ||
() => console.log(`Started polling ${telegram.bot.data}!`) | ||
); | ||
@@ -34,0 +34,0 @@ ``` |
@@ -5,2 +5,4 @@ import API from './api'; | ||
import { IUser } from '../typings/interfaces'; | ||
declare class Telegram { | ||
@@ -10,2 +12,7 @@ public api: API; | ||
/** | ||
* Can be accessed only after `startPolling` method | ||
*/ | ||
public bot: IUser; | ||
constructor(params: Params.ITelegramParams); | ||
@@ -12,0 +19,0 @@ } |
@@ -6,2 +6,4 @@ let middlewareIo = require('middleware-io'); | ||
let User = require('./structures/user'); | ||
let contexts = { | ||
@@ -127,2 +129,10 @@ message: Contexts.Message, | ||
// Fetching bot data | ||
let data = await this.api.getMe(); | ||
this.telegram.bot = new User(data); | ||
debug('Fetched bot data'); | ||
debug(this.telegram.bot); | ||
try { | ||
@@ -129,0 +139,0 @@ this.startFetchLoop(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
773014
23283