diff options
author | Eric Wang <gnawrice@gmail.com> | 2017-10-10 00:55:01 -0700 |
---|---|---|
committer | Eric Wang <gnawrice@gmail.com> | 2017-10-10 00:55:01 -0700 |
commit | 4bdc294fbcd502ca693028a6a93ccbcadd3e1e12 (patch) | |
tree | 5a48c66a9656b970a15ee5b3a524adffd3d20ccf | |
parent | 31c7e9acde467b8df8efc319fad1971d387b1361 (diff) | |
download | wee-slack-4bdc294fbcd502ca693028a6a93ccbcadd3e1e12.tar.gz |
Fix errors when joining DMs and multiparty DMs
- The DM error was caused by not specifying `return_im`
(https://api.slack.com/methods/im.open#arguments) in the request which
led to `unread_count_display` not being included in the response and a
KeyError in `handle_imopen`
- The MPDM error was caused by using "name" instead of "channel" for the
channel ID (https://api.slack.com/methods/groups.info#arguments) in the
request which led to an error response and a KeyError in
`handle_groupsinfo`
-rw-r--r-- | wee_slack.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 146f359..b41bca9 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1624,7 +1624,7 @@ class SlackDMChannel(SlackChannel): self.eventrouter.receive(s) if update_remote: if "join" in SLACK_API_TRANSLATOR[self.type]: - s = SlackRequest(self.team.token, SLACK_API_TRANSLATOR[self.type]["join"], {"user": self.user}, team_hash=self.team.team_hash, channel_identifier=self.identifier) + s = SlackRequest(self.team.token, SLACK_API_TRANSLATOR[self.type]["join"], {"user": self.user, "return_im": "true"}, team_hash=self.team.team_hash, channel_identifier=self.identifier) self.eventrouter.receive(s) self.create_buffer() @@ -1675,7 +1675,7 @@ class SlackMPDMChannel(SlackChannel): self.active = True self.get_history() if "info" in SLACK_API_TRANSLATOR[self.type]: - s = SlackRequest(self.team.token, SLACK_API_TRANSLATOR[self.type]["info"], {"name": self.identifier}, team_hash=self.team.team_hash, channel_identifier=self.identifier) + s = SlackRequest(self.team.token, SLACK_API_TRANSLATOR[self.type]["info"], {"channel": self.identifier}, team_hash=self.team.team_hash, channel_identifier=self.identifier) self.eventrouter.receive(s) # self.create_buffer() |