Bottr icon indicating copy to clipboard operation
Bottr copied to clipboard

[Question] TypeError: session.getUserContext is not a function

Open mkneib opened this issue 7 years ago • 1 comments

Hi,

i,ve tried to add functionality as described as first steps here.

https://bottr.co/docs/adding-functionality.html

This ends in an error, when typing "/stats"

/Users/user/botName/index.js:10
 var context = session.getUserContext({
                       ^

TypeError: session.getUserContext is not a function
    at Event.<anonymous> (/Users/user/botName/index.js:10:24)
    at Event.next (/Users/user/botName/node_modules/bottr/lib/event.js:16:14)
    at Event.triggerNext (/Users/user/botName/node_modules/bottr/lib/event.js:10:12)
    at Event.<anonymous> (/Users/user/botName/node_modules/bottr/lib/bot.js:22:5)
    at Event.next (/Users/user/botName/node_modules/bottr/lib/event.js:16:14)
    at EventEmitter.emit (/Users/user/botName/node_modules/bottr/lib/event-emitter.js:28:9)
    at Bot.trigger (/Users/user/botName/node_modules/bottr/lib/bot.js:49:26)
    at WebsocketClient.<anonymous> (/Users/user/botName/node_modules/bottr/lib/websocket-client.js:24:14)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at /Users/user/botName/node_modules/socket.io/lib/socket.js:503:12
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)`

The function getUserContext is not declared in the file

/Users/user/botName/node_modules/bottr/lib/session.js
.```

What did i miss? I am new to nodejs.

mkneib avatar May 17 '17 10:05 mkneib

When I see this correctly the current npm package which is installed via bottr init is not the same version as in the master branch

sebastiangrebe avatar Jun 07 '17 17:06 sebastiangrebe