diff --git a/build/index.js b/build/index.js index bde391d..6f3e16f 100644 --- a/build/index.js +++ b/build/index.js @@ -196,7 +196,10 @@ var Bot = (function (_EventEmitter) { } update.forEach(function (res) { + console.log(res); var text = res.message.text; + if (!text) return; + var selfUsername = '@' + _this2.info.username; if (text.startsWith('/') && text.indexOf(selfUsername) > -1) { diff --git a/lib/index.js b/lib/index.js index 1d9add8..08f5ca8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -146,6 +146,8 @@ export default class Bot extends EventEmitter { update.forEach(res => { let text = res.message.text; + if (!text) return; + const selfUsername = `@${this.info.username}`; if (text.startsWith('/') && text.indexOf(selfUsername) > -1) { diff --git a/package.json b/package.json index 61cccb8..b9aa23a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "telegram-api", - "version": "0.4.71", + "version": "0.4.72", "description": "Control Telegram bots easily using the new Telegram API", "main": "index.js", "scripts": {