Skip to content
This repository was archived by the owner on Jan 19, 2020. It is now read-only.

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

@mkneib

Description

@mkneib

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions