Skip to content
Kinda low-level tlkio-client used by hubot-tlkio and my own tlkio-bot
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Kinda low-level tlkio-client used by the hubot adapter hubot-tlkio and my own little Bot tlkio-bot.

Getting Started

To install just use:

npm install tlkio-client --save


    TlkIoClient = require 'tlkio-client'

    settings =
      room : process.argv[2] or 'tlkio-client-test'
      user :
        nickname : 'Bot'

    client = new TlkIoClient(settings)

Just create a config object an pass it in the TlkIoClient constructor. Than you can listen to events like this:

    client.on 'init', (tlkio) ->
      console.log 'Init Done'
      client.say 'I am online'

    client.on 'message', (message) ->
      console.log "#{message.text} from #{}"

    client.on 'user_joined', (user) ->
      console.log "user_joined, #{} #{}"x

    client.on 'user_left', (user) ->
      console.log "user_left, #{}"


init - Will be invoked when the connection is established. The tlkio object will hold some metadata

message - Some user wrote a message. The message object which is passed

    text  : 'Raw text'
    html  : '<b>Raw</b> text'
      id   : 'UID'
      name : 'username'
      deteils :
        twitter : true|false
        avatar  : 'url to Avatar'

user_joind - a user joined the room. The user object:

    id : 'UID'
    name : 'username'
    details :
      twitter : true|false
      avatar  : 'url'

ùser_left - a user left the room. The user object:

    id : 'uid'
Something went wrong with that request. Please try again.