Naltox / telegram-node-bot

Node module for creating Telegram bots.
MIT License
721 stars 143 forks source link

ReferenceError: Proxy is not defined #68

Closed jurgob closed 8 years ago

jurgob commented 8 years ago

If I try to run the example, I get this error:

MLGBJBOEMO:circle_ci_bot jurgo.boemo$ node index.js 
/Users/jurgo.boemo/WorkspacePhun/circle_ci_bot/node_modules/telegram-node-bot/lib/localization/Ivan.js:41
        return new Proxy(this, locHandler)
                   ^

ReferenceError: Proxy is not defined
    at new Ivan (/Users/jurgo.boemo/WorkspacePhun/circle_ci_bot/node_modules/telegram-node-bot/lib/localization/Ivan.js:41:20)
    at new Telegram (/Users/jurgo.boemo/WorkspacePhun/circle_ci_bot/node_modules/telegram-node-bot/lib/Telegram.js:37:20)
    at Object.<anonymous> (/Users/jurgo.boemo/WorkspacePhun/circle_ci_bot/index.js:6:12)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:142:18)
    at node.js:939:3

my node version is 5.9.1

Naltox commented 8 years ago

@jurgob Hi!

You need to update your node to latest version. (6.2.2 now)

jurgob commented 8 years ago

yep, updating to node 6 ha fixed the problem. Maybe it should be mentioned in the ReadMe

jurgob commented 8 years ago

now I can receive the message, but when I try to do $.sendMessage('pong') I get the following error:

Cant find controller for update Update {
  _updateId: '******,
  _message: 
   Message {
     _messageId: 11,
     _from: 
      User {
        _id: '******,
        _firstName: '******',
        _lastName: ''******',
        _username: ''******' },
     _date: '******,
     _chat: 
      Chat {
        _id: -'******,
        _type: 'group',
        _title: 'test',
        _username: null,
        _firstName: null,
        _lastName: null },
     _forwardFrom: null,
     _forwardFromChat: null,
     _forwardDate: null,
     _replyToMessage: null,
     _editDate: null,
     _text: '/chat_id@circle_bot',
     _entities: [ [Object] ],
     _audio: null,
     _document: null,
     _photo: null,
     _sticker: null,
     _video: null,
     _voice: null,
     _caption: null,
     _contact: null,
     _location: null,
     _venue: null,
     _newChatMember: null,
     _leftChatMember: null,
     _newChatTitle: null,
     _newChatPhoto: null,
     _deleteChatPhoto: null,
     _groupChatCreated: null,
     _supergroupChatCreated: null,
     _channelChatCreated: null,
     _migrateToChatId: null,
     _migrateFromChatId: null,
     _pinnedMessage: null },
  _editedMessage: null,
  _inlineQuery: null,
  _chosenInlineResult: null,
  _callbackQuery: null }
Naltox commented 8 years ago

@jurgob Its not an error, its just a warning that you dont have a controller for such messages

jurgob commented 8 years ago

ok, but I don't see the "pong" response on my chat. I'm running on my localhost, is this the problem?

jurgob commented 8 years ago

sorry, my fault, you are right

Naltox commented 8 years ago

@jurgob According to the warning - your code not going to be executed.