bhouse / lita-flowdock Goto Github PK
View Code? Open in Web Editor NEWFlowdock adapter for the lita.io chatbot
Home Page: https://lita.io
License: MIT License
Flowdock adapter for the lita.io chatbot
Home Page: https://lita.io
License: MIT License
In our organisation we have ~1000 members. When this adapter starts up, it caches all of them as User objects which can take quite some time (~15 minutes). This is rather silly when some bots may only be added to a single private flow with ~20 members. As such, this adapter should be smarter in which users it loads - it should only load members of the flows which it is told to join.
When following the Getting Started guide there is a failure executing this step:
bundle install --path vendor/bundle
using the latest development vagrant box provided by lita.
Error Snippet:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
The error is related to the eventmachine gem.
the flowdock adapter should allow lita to respond to private messages. It should be configurable to:
:disabled
- don't respond to any private messages:help
- only respond to help
commands in private messages:enabled
- respond to any private messageCreate a flowdock room called testing-room
Add your bot to the room
Now try to response.reply and notice that you get a 403 for some reason.
One of the best features of Flowdock are message threads:
In order to thread a message, we need to respond with the original message id in the api call:
# Send a comment to message 1234
client.chat_message(flow: flow_id, content: "Now I'm commenting!", message: 1234)
I'm not sure how Lita will track the message id when it signals the robot.receive(message)
, so handlers can pass the message id back to send_messages
, maybe with an Lita extension?
Right now the EventMachine.run
loop is being closed on shutdown by calling source.close
from outside the loop
https://github.com/bhouse/lita-flowdock/blob/master/lib/lita/adapters/flowdock.rb#L27-L35
https://github.com/bhouse/lita-flowdock/blob/master/lib/lita/adapters/flowdock/connector.rb#L56-L58
This triggers a RuntimeError
, which is currently being rescued:
[2015-02-08 05:42:18 UTC] INFO: Connected to flowdock streaming API
^C[2015-02-08 05:42:21 UTC] ERROR: "Connection lost. Reconnecting."
/vagrant/vendor/bundle/ruby/2.1.0/gems/eventmachine-1.0.6/lib/em/connection.rb:266:in `close_connection': eventmachine not initialized: evma_close_connection (RuntimeError)
from /vagrant/vendor/bundle/ruby/2.1.0/gems/eventmachine-1.0.6/lib/em/connection.rb:266:in `close_connection'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/em-http-request-1.1.2/lib/em-http/http_connection.rb:198:in `unbind'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/em-eventsource-0.2.0/lib/em-eventsource.rb:107:in `close'
from /vagrant/lita-flowdock/lib/lita/adapters/flowdock/connector.rb:57:in `shut_down'
from /vagrant/lita-flowdock/lib/lita/adapters/flowdock.rb:34:in `shut_down'
from /vagrant/lita-flowdock/lib/lita/adapters/flowdock.rb:29:in `rescue in run'
from /vagrant/lita-flowdock/lib/lita/adapters/flowdock.rb:19:in `run'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/lita-4.2.0/lib/lita/robot.rb:69:in `run'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/lita-4.2.0/lib/lita.rb:79:in `run'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/lita-4.2.0/lib/lita/cli.rb:77:in `start'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /vagrant/vendor/bundle/ruby/2.1.0/gems/lita-4.2.0/bin/lita:6:in `<top (required)>'
from /vagrant/vendor/bundle/ruby/2.1.0/bin/lita:23:in `load'
from /vagrant/vendor/bundle/ruby/2.1.0/bin/lita:23:in `<main>'
messages in a flowdock thread have event type comment
instead of message
, which isn't currently handled.
No tests exist yet for the EventMachine loop. Might be possible to use the approace from em-eventsource, but I haven't tried it yet.
Hello,
any plan to release the new version with the changes applied after May release ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.