diff --git a/lib/index.js b/lib/index.js index d238c29..fb6146b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -140,7 +140,9 @@ export default class Bot extends EventEmitter { update.forEach(res => { let text = res.message.text; - if (text.startsWith('/')) { + const selfUsername = `@${this.info.username}`; + + if (text.startsWith('/') && text.indexOf(selfUsername) > -1) { // Commands are sent in /command@thisusername format in groups const regex = new RegExp(`(/.*)@${this.info.username}`); text = text.replace(regex, '$1'); diff --git a/package.json b/package.json index b03713f..3036faa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "telegram-api", - "version": "0.4.61", + "version": "0.4.62", "description": "Control Telegram bots easily using the new Telegram API", "main": "index.js", "scripts": {