From 8a7663399a1ca723f008fd7ca3eb05aa662aab38 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Wed, 22 Jan 2020 21:10:16 +0100 Subject: Set channel.is_member when channel is created The channel dict sent as kwargs to SlackChannel from handle_rtmstart contains the is_member property. However the one from process_channel_created doesn't. Since you never are a member when the channel is created, we can set it to false (if you create the channel yourself or is invited immediately a channel_joined message will follow the channel_created message). --- wee_slack.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wee_slack.py b/wee_slack.py index cf67593..beb1c7f 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -3177,6 +3177,7 @@ def process_channel_joined(message_json, eventrouter, **kwargs): def process_channel_created(message_json, eventrouter, **kwargs): item = message_json["channel"] + item['is_member'] = False c = SlackChannel(eventrouter, team=kwargs["team"], **item) kwargs['team'].channels[item["id"]] = c kwargs['team'].buffer_prnt('Channel created: {}'.format(c.slack_name)) -- cgit