lukefx / hubot-telegram

Hubot adapter for Telegram
MIT License
160 stars 42 forks source link

/ commands in supergroups not working #62

Open MTRNord opened 7 years ago

MTRNord commented 7 years ago

Hi My hubot doesn't listen to slash commands in supergroups. privacy mode on or off no change. only mentions are working. Debug:

[Tue Jun 27 2017 08:40:23 GMT+0000 (UTC)] DEBUG { update_id: 615849531,
  message:
   { message_id: 234,
     from:
      { id: SECRET,
        first_name: 'SECRET',
        username: 'mtrnord',
        language_code: 'de' },
     chat:
      { id: -SECRET,
        title: 'SECRET',
        type: 'supergroup' },
     date: 1498552821,
     text: '/help',
     entities: [ [Object] ] } }
[Tue Jun 27 2017 08:40:23 GMT+0000 (UTC)] INFO Receiving message_id: 234
[Tue Jun 27 2017 08:40:23 GMT+0000 (UTC)] DEBUG Received message: mtrnord said '/help'
[Tue Jun 27 2017 08:40:23 GMT+0000 (UTC)] DEBUG No listeners executed; falling back to catch-all
[Tue Jun 27 2017 08:40:23 GMT+0000 (UTC)] DEBUG Executing listener callback for Message '[object Object]'
arcturial commented 7 years ago

The issue seems to be that cleanMessageText method does not remove forward slashes properly when it's in a group chat.

MTRNord commented 7 years ago

Am I correct that for using slash commands the same regex as in privat chats is needed?