Don't process messages without a text
This commit is contained in:
parent
5c36581e08
commit
bdfd4ee99d
@ -196,7 +196,10 @@ var Bot = (function (_EventEmitter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update.forEach(function (res) {
|
update.forEach(function (res) {
|
||||||
|
console.log(res);
|
||||||
var text = res.message.text;
|
var text = res.message.text;
|
||||||
|
if (!text) return;
|
||||||
|
|
||||||
var selfUsername = '@' + _this2.info.username;
|
var selfUsername = '@' + _this2.info.username;
|
||||||
|
|
||||||
if (text.startsWith('/') && text.indexOf(selfUsername) > -1) {
|
if (text.startsWith('/') && text.indexOf(selfUsername) > -1) {
|
||||||
|
@ -146,6 +146,8 @@ export default class Bot extends EventEmitter {
|
|||||||
|
|
||||||
update.forEach(res => {
|
update.forEach(res => {
|
||||||
let text = res.message.text;
|
let text = res.message.text;
|
||||||
|
if (!text) return;
|
||||||
|
|
||||||
const selfUsername = `@${this.info.username}`;
|
const selfUsername = `@${this.info.username}`;
|
||||||
|
|
||||||
if (text.startsWith('/') && text.indexOf(selfUsername) > -1) {
|
if (text.startsWith('/') && text.indexOf(selfUsername) > -1) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "telegram-api",
|
"name": "telegram-api",
|
||||||
"version": "0.4.71",
|
"version": "0.4.72",
|
||||||
"description": "Control Telegram bots easily using the new Telegram API",
|
"description": "Control Telegram bots easily using the new Telegram API",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
Reference in New Issue
Block a user