Comments (14)
(Sorry about my poor English.)
I have a same issue.
With node-inspector, I confirmed hubot receive the messages, but it never responds.
I found a suspicious code area in listener.coffee by step-by-step execution
I might be wrong,but It looks that all message doesn't match any listeners
.
from hubot-slack.
Without slack adapter, hubot responds normally.
For your reference,I attach a screenshot for this case.
from hubot-slack.
On Debugger, I executed the following code for bypassing the 'instanceOf' check.
message.__proto__ = TextMessage.prototype
It works. How strange?
from hubot-slack.
Setting the __proto__
did not work for me. After some debugging it appears that the structure of message
has somehow changed. Modifying the "instanceof" to the code below fixed the problem for me:
if message.message? and message.message.text?
message.message.text.match @regex
from hubot-slack.
Iapologize for not providing you with enough explanation.
Some hubot messages are not TextMessage truly, so the __proto__
don't work in such cases.
hubot has several message types:
TextMessage,EmoteMessage,EnterMessage,LeaveMessage,TopicMessage,CatchAllMessage
Because the condition expression in your code matches instances of TextMessage,it seems to work.
I don't know whether it is a robust solution,but I'll try it later anyway.
Thanks for sharing experience.
from hubot-slack.
Does Slack support EmoteMessage,EnterMessage,LeaveMessage,TopicMessage?
Also , @svmaris are you saying that this more of a hubot problem than slack then? or Slack is passing the wrong Type of message?
from hubot-slack.
Also I tried to change the listener.coffee .. and I see it going further but sill some errors now
[Fri Oct 03 2014 21:53:34 GMT+0000 (UTC)] ERROR TypeError: Cannot call method 'match' of undefined
at TextListener.callback (/mnt/zubot/scripts/google-images.coffee:24:8, :20:19)
at TextListener.Listener.call (/mnt/zubot/node_modules/hubot/src/listener.coffee:27:7, :23:14)
at Robot.receive (/mnt/zubot/node_modules/hubot/src/robot.coffee:197:9, :142:33)
at Robot.receive (/mnt/zubot/node_modules/hubot/src/robot.coffee:204:7, :153:21)
at Slack.Adapter.receive (/mnt/zubot/node_modules/hubot/src/adapter.coffee:66:5, :47:25)
at /mnt/zubot/node_modules/hubot-slack/src/slack.coffee:182:26, :185:16
at callbacks (/mnt/zubot/node_modules/hubot/node_modules/express/lib/router/index.js:161:37)
at param (/mnt/zubot/node_modules/hubot/node_modules/express/lib/router/index.js:135:11)
at pass (/mnt/zubot/node_modules/hubot/node_modules/express/lib/router/index.js:142:5)
at Router._dispatch (/mnt/zubot/node_modules/hubot/node_modules/express/lib/router/index.js:170:5)
at Object.router (/mnt/zubot/node_modules/hubot/node_modules/express/lib/router/index.js:33:10)
at next (/mnt/zubot/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at multipart (/mnt/zubot/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/multipart.js:60:27)
at /mnt/zubot/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:57:9
at IncomingMessage. (/mnt/zubot/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/urlencoded.js:70:11)
at IncomingMessage.emit (events.js:92:17)
at _stream_readable.js:943:16
at process._tickCallback (node.js:419:13)
Sending message
Sending message
Sending message
Sending message
Sending message
Sending message
Failed to escape HTML: TypeError: Cannot call method 'replace' of undefined
Sending message
Sending message
from hubot-slack.
Seems that either Slack is using the wrong Message type or something is really broken :(
from hubot-slack.
I tried the @svmaris's hack and It works for me.
from hubot-slack.
I just setup hubot on Heroku with Slack and it worked fine :)
from hubot-slack.
I have same problem and solve. Check to see if the same two 'message.coffee' files. I had two message.coffee files in the different hubot packages.
from hubot-slack.
Hubot on heroku is receiving messages but never responds in any slack channel.
Anyone have any ideas?
from hubot-slack.
The recent v3 release of hubot-slack completely rewrites all of the code around how hubot communicates with slack, and any bugs in the old code won't be present in the new code. I hate to do this, but I'm going to close out this issue because we're not working on the old version any more. Sorry we didn't reply sooner.
We think the new adapter is much better in many ways. Try it out, and if it still doesn't work for you please feel free to open a new issue or email [email protected] so we can look into it.
from hubot-slack.
Sounds great. Will give it a to V3
from hubot-slack.
Related Issues (20)
- Get the last reply in a thread HOT 4
- @slack/client is no longer developed, and its dependency "ws" has a security vulnerability HOT 2
- Replace RTM API with Event API for hubot slack adapter HOT 5
- Change the default settings to "useRtmConnect: true"
- Hubot failing to set up with error: Response not OK: method_deprecated HOT 4
- Problem setting up slack token HOT 4
- @slack/client dependency "async" has a security vulnerability HOT 2
- Best Interior Designers in Noida
- Can not trigger listener sometimes. HOT 6
- After SlackClient#send(), I can not receive message sometimes HOT 5
- DEBUG Received file_shared message from: undefined, file_id: F03PMLTMBNE HOT 4
- How to HOT 1
- unable to get response from hubot HOT 3
- App user who is initiating action is identified as channel instead of App name HOT 5
- Port hubot-slack away from @slack/client? HOT 2
- Rtm.start not getting replaced by rtm.connect HOT 6
- slack bot respond only once in the thread message HOT 3
- RTMClient failed to connect HOT 15
- hubot@>4.0.0 Cannot load adapter HOT 11
- Deleted Message Event HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hubot-slack.