Permalink
Browse files

let say() take params

  • Loading branch information...
1 parent ac0af38 commit b4755733c6c76e8f04c125109c0aa074aa2a07f9 @substack substack committed Nov 11, 2012
Showing with 12 additions and 6 deletions.
  1. +11 −5 logic.js
  2. +1 −1 package.json
View
@@ -110,11 +110,17 @@ function api (row) {
return dist(row, other)
},
- say: function (text) {
- if(text) {
- if(text.toString().length > 140)
- text = text.toString().substring(0, 140)
- row.set('message', {text: text})
+ say: function (text, opts) {
+ if(!opts) opts = {}
+ if(typeof text === 'object') {
+ opts = text
+ }
+ else opts.text = text
+
+ if(opts.text) {
+ if(String(opts.text).length > 140)
+ opts.text = String(text).substring(0, 140)
+ row.set('message', opts)
model.emit('say', text, self.id())
}
return self
View
@@ -1,6 +1,6 @@
{
"name": "nko3-teh-wizzards-of-stre",
- "version": "0.0.3-4",
+ "version": "0.0.4",
"description": "teh_wizzards_of_streamz",
"main": "server.js",
"scripts": {

0 comments on commit b475573

Please sign in to comment.