-
Notifications
You must be signed in to change notification settings - Fork 838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added rtm.connect support and fixed rtm_send_message #215
Conversation
Codecov Report
@@ Coverage Diff @@
## master #215 +/- ##
==========================================
- Coverage 61.84% 59.67% -2.17%
==========================================
Files 9 9
Lines 304 310 +6
Branches 56 57 +1
==========================================
- Hits 188 185 -3
- Misses 102 111 +9
Partials 14 14
Continue to review full report at Codecov.
|
slackclient/client.py
Outdated
@@ -134,29 +136,6 @@ def rtm_read(self): | |||
else: | |||
raise SlackNotConnected | |||
|
|||
def rtm_send_message(self, channel, message, thread=None, reply_broadcast=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need this method back! i'm guessing the implementation just needs to call self.server.rtm_send_message()
with maybe some ID translation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__,-- _ _,-'_)_ (""`'-._\ `.
_,' __ |,' ,-' __) ,- /. |
,'_,--' | -' _)/ `\
,',' ,' ,-'_,` :
,' ,-' ,(,-( :
,' ,-' , _ ;
/ ,-._/`---' /
/ (____)(----. ) ,'
/ ( `.__, /\ /,
: ;-.___ /__\/|
| ,' `--. -,\ |
: / \ .__/
\ (__ \ |_
\ ,`-, * / _|,\
\ ,' `-. ,'_,-' \
(_\,-' ,'\")--,'-' __\
\ / // ,'| ,--' `-.
`-. `-/ \' | _,' `.
`-._ / `--'/ \
,' | \
/ | \
,-' | /
/ | -'
slackclient/client.py
Outdated
found_channel = self.server.channels.find(channel) | ||
if found_channel: | ||
# If the channel is found in cache, send to it's `send_message` method | ||
return found_channel.send_message( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why call this method on the channel if its just going to bounce out to server? i think you can consolidate some code if you just always call the method on server, just use found_channel.id
as the argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll update it.
you knew it was coming, @Roach. "TESTS?" |
🎉 |
* Added rtm.connect support * updated docs * updated gitignore * Uncommented lines which were accidentally left commented * Updated docs * Removed ignored doc source files * Fixed typo in method docs * fixed line length * updated rim start tests * regenerated docs * Moved rtm_send_message from channel into client, removed dependance on channel object * Fixed rtm_send_message * Added missing newline * Removed duplicate line * Changed to for accuracy * Fixed channel send_message tests * Removed extra line to appease flake8 * New and improved client.send_rtm_message * Fixed rtm_send_message, again...
Summary
Added rtm.connect support and fixed rtm_send_message
Requirements (place an
x
in each[ ]
)