diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-08-24 18:31:31 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-08-25 19:42:06 +0200 |
commit | 97ea3ae638ced4908bdd259e8d2c3c6996f0b1e9 (patch) | |
tree | 7e3931759042e463bfe7809d9cc589bc1fc4e8a0 /wee_slack.py | |
parent | 5e43f251b45ece5548cb5a4f141397787297533b (diff) | |
download | wee-slack-97ea3ae638ced4908bdd259e8d2c3c6996f0b1e9.tar.gz |
Render group notifications with @ instead of !
This is for the notifications @channel, @everyone, @group and @here.
@group isn't mentioned in the documentation[0], but it is still rendered
as a highlight in the web client, so I included it.
[0]: https://get.slack.help/hc/en-us/articles/202009646-Notify-a-channel-or-workspace
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 2024824..8c68e90 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1687,7 +1687,7 @@ class SlackChannel(SlackChannelCommon): if self.muted and config.muted_channels_activity == "personal_highlights": return personal_highlights else: - return personal_highlights.union({"!here", "!channel", "!everyone"}) + return personal_highlights.union({"@channel", "@everyone", "@group", "@here"}) def set_highlights(self): # highlight my own name and any set highlights @@ -3363,7 +3363,9 @@ def unwrap_files(message_json, text_before): def resolve_ref(ref): for team in EVENTROUTER.teams.values(): - if ref.startswith('@U') or ref.startswith('@W'): + if ref in ['!channel', '!everyone', '!group', '!here']: + return ref.replace('!', '@') + elif ref.startswith('@U') or ref.startswith('@W'): user = team.users.get(ref[1:]) if user: suffix = config.external_user_suffix if user.is_external else '' |