diff options
author | David Vo <auscompgeek@users.noreply.github.com> | 2019-03-22 18:20:13 +1100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-03-26 17:13:54 +0100 |
commit | ea27ddfedcb4f68ff2e478557e680096b8701b12 (patch) | |
tree | 072ef170ba02ea0bf7504b8b12d8f785d5e32605 | |
parent | e3db8e6f9966d1205e0e194cac0b7421d5006ebd (diff) | |
download | wee-slack-ea27ddfedcb4f68ff2e478557e680096b8701b12.tar.gz |
Correctly handle group join/leave events
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index a22c89e..1c15b04 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2222,7 +2222,7 @@ class SlackMessage(object): if (self.message_json.get('subtype') == 'me_message' and not self.message_json['text'].startswith(self.sender)): text = "{} {}".format(self.sender, text) - if (self.message_json.get('subtype') == 'channel_join' and + if (self.message_json.get('subtype') in ('channel_join', 'group_join') and self.message_json.get('inviter')): inviter_id = self.message_json.get('inviter') inviter_nick = unfurl_refs("<@{}>".format(inviter_id)) @@ -2742,6 +2742,10 @@ def subprocess_channel_leave(message_json, eventrouter, channel, team): # channel.update_nicklist() +subprocess_group_join = subprocess_channel_join +subprocess_group_leave = subprocess_channel_leave + + def subprocess_message_replied(message_json, eventrouter, channel, team): parent_ts = message_json["message"].get("thread_ts") parent_message = channel.messages.get(SlackTS(parent_ts)) |