Skip to content
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

Merged
merged 20 commits into from
Aug 31, 2017
Merged

Conversation

Roach
Copy link
Contributor

@Roach Roach commented Aug 26, 2017

Summary

Added rtm.connect support and fixed rtm_send_message

Requirements (place an x in each [ ])

@codecov
Copy link

codecov bot commented Aug 29, 2017

Codecov Report

Merging #215 into master will decrease coverage by 2.16%.
The diff coverage is 30.43%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
slackclient/channel.py 76.19% <100%> (-4.58%) ⬇️
slackclient/client.py 37.5% <20%> (-1.39%) ⬇️
slackclient/server.py 59.05% <29.41%> (-2.81%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d83bb74...4f9f3b8. Read the comment docs.

@@ -134,29 +136,6 @@ def rtm_read(self):
else:
raise SlackNotConnected

def rtm_send_message(self, channel, message, thread=None, reply_broadcast=None):
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

           __,-- _ _,-'_)_  (""`'-._\ `. 
        _,'  __ |,' ,-' __)  ,-     /. | 
      ,'_,--'   |     -'  _)/         `\ 
    ,','      ,'       ,-'_,`           : 
    ,'     ,-'       ,(,-(              : 
         ,'       ,-' ,    _            ; 
        /        ,-._/`---'            / 
       /        (____)(----. )       ,' 
      /         (      `.__,     /\ /, 
     :           ;-.___         /__\/| 
     |         ,'      `--.      -,\ | 
     :        /            \    .__/ 
      \      (__            \    |_ 
       \       ,`-, *       /   _|,\ 
        \    ,'   `-.     ,'_,-'    \ 
       (_\,-'    ,'\")--,'-'       __\ 
        \       /  // ,'|      ,--'  `-. 
         `-.    `-/ \'  |   _,'         `. 
            `-._ /      `--'/             \ 
               ,'           |              \ 
              /             |               \ 
           ,-'              |               / 
          /                 |             -' 

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(
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@aoberoi
Copy link
Contributor

aoberoi commented Aug 31, 2017

you knew it was coming, @Roach. "TESTS?"

:trollface:

@Roach Roach merged commit 8e8f0ba into master Aug 31, 2017
@aoberoi
Copy link
Contributor

aoberoi commented Aug 31, 2017

🎉

@Roach Roach deleted the roach/rtm.connect branch September 14, 2017 19:21
c-goosen pushed a commit to c-goosen/python-slackclient that referenced this pull request Jun 18, 2019
* 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...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants