A client for the Talker chat service
A high-ish level interface for Talker
var Talker = require'talker-client'client = account: 'test' token: 'your token here'clientgetRoomsvar firstRoom = roomspoproom = clientjoinfirstRoomidroomon'users'console.log'users currently connected' messageusersmessageusersforEachif username === 'paul.sweeney' roommessage'oh hai, Paul!'
var client = account: 'your account' token: 'your token'
account is your Talker subdomain (eg:
token is account token, you can find this by going to http://talkerapp.com/settings
Returns a list of rooms, and the list of users for each room:
Return an instance of the
rooms is a key/value hash of room IDs to their connected room instaces. eg:
var client =clientjoin1234clientroom1234send'Oh hai'
Room events are emitted on the client directly, with the first parameter
being the room ID and the second being the event payload:
var client =room = clientjoin1234clienton'message'roomon'message'
Created by calling
join on a Talker client instance
Sends a mesasge to the room. Specifying a user ID as the second parameter will send a private message to that user.
Leaves a room.
Emitted when you've connected to the Talker Room
Emitted whenever the client encounters an error from Talker
Emitted when a user in the talker room sends a message:
Emitted when a new user joins the room
Emitted when you join a room, the payload is a list of all the users currently in the room:
Emitted when a user in the room goes idle
Emitted when a user in the room returns from being idle
Emitted when a user leaves the room