Skip to content

Conversation

@soundstorm
Copy link

By using #channel or @user in channel list it's possible to post to channels or (only already contacted) users.
Limited to first 50 visible channels, as paging does not work with RocketChatAPI.
Somehow posting images to RC does not work.

Closes #92

By using `#channel` or `@user` in channel list it's possible to post to channels or (only *already contacted*) users.
Limited to first 50 visible channels, as paging does not work with `RocketChatAPI`.
Somehow posting images to RC does not work.
@soundstorm
Copy link
Author

But maybe a PR at rocket-python would be necessary too, to get this working well. Iterating over a list of channels is not the best option but was the fastest to implement when using this particular library which doesn't offer better methods.
Posting of images needs investigation too.

Otherwise would raise a NameError instead of the defined Exception
GitHub Web on mobile is awful
@soundstorm
Copy link
Author

Okay, posting of images was my fault, as the bot user role in my RC hadn't the permission post-readonly (couldn't upload files but post messages, uuuhm?)

We may wait for Pipoline/rocket-python#49 as the code would be much better then:

                        rc_room_id = None
                        if channel[0] == "#":
                            rc_room_id = rc.get_public_room_id(channel[1:])
                        elif channel[0] == "@":
                            rc_self = rc.get_my_info()
                            # generate room id by concatenating the user ids
                            rc_room_id = rc.get_user_id(channel[1:]) + rc_self['_id']
                        else: # backwards compatibility with no # or @ to post to groups
                            rc_room_id = rc.get_room_id(channel) #groups

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.

RocketChat: only available for private groups

1 participant