Skip to content

Commit

Permalink
Merge pull request MathildeLemee#3 from jingweno/master
Browse files Browse the repository at this point in the history
Make hubot-twitter work with the latest Hubot 2.0.7
  • Loading branch information
MathildeLemee committed Dec 12, 2011
2 parents 073ae7d + a6de201 commit c124056
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
8 changes: 4 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "hubot-twitter",
"version": "2.0.2",
"version": "2.0.3",
"author": "Mathilde Lemee",
"keywords": [
"github hubot twitter adapter"
Expand All @@ -17,11 +17,11 @@
"url": "git://github.com/mathildelemee/hubot-twitter.git"
},
"dependencies": {
"hubot": "2.0.0"
"hubot": ">=2.0.5",
"oauth": "0.9.5"
},
"devDependencies": {
"coffee-script": "1.1.3",
"oauth": "0.9.5"
"coffee-script": "1.1.3"
},
"main": "./src/twitter",
"engine": "node > 0.6.0 < 0.7.0",
Expand Down
6 changes: 5 additions & 1 deletion src/twitter.coffee
Expand Up @@ -30,7 +30,11 @@ class Twitter extends Adapter
bot.tweet self.robot.name, (err, data) ->
reg = new RegExp('@'+self.robot.name,'i')
console.log "received #{data.text} from #{data.user.screen_name}"
self.receive new Robot.TextMessage data.user.screen_name,data.text.replace reg, self.robot.name

message = data.text.replace reg, self.robot.name
console.log "hubot command: #{message}"

self.receive new Robot.TextMessage data.user.screen_name, message
if err
console.log "received error: #{err}"

Expand Down

0 comments on commit c124056

Please sign in to comment.