Open csaftoiu opened 8 years ago
Oh boy, didn't see #89 and #54 already. Hmm well I'll leave this open as it's another approach. It's basically like #54 except it provides easy access to the client
right there, and a nicer interface for sending messages (using channel names & usernames instead of ids).
Also it opens direct message channels if they aren't open yet. I think this may be necessary for messaging a user who has never messaged you, for example.
@lins05 due to @prathyush not updating his PR, do you think we could focus on this one and fix what is needed to merge it? I think this would be really useful for slackbot.
sad this isn't merged.. this is a killer PR
Looks awesome! I'm excited to see this merged!
Any chance of this being merged?
Is there any plan for this PR to be merged? I've seen that there are requests for changes. @csaftoiu any thoughts? In a fork of this repo I managed to build on top of the functionality added by @csaftoiu and added the possibility of running a function at certain times.
The approach is to use an idle handler, which gets called whenever something else hasn't already happened, or once per second. This should help reduce rate limiting.
Functional testing has been added.
Updated README.md with how to use the new functionality.
Resolves #92.
Dev Notes
To allow the idle handler to send messages, I give it the instance of the
SlackClient
as a parameter.To make
SlackClient
easier to use, I madesend_message
,rtm_send_message
, andupload_file
all take a "channelish" string, instead of a channel. This turns a string into a channel as follows:This way a user can just
client.send_message("some_user", "Here the message")
instead of having to call any other helper functions.