aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorImmae <immae@users.noreply.github.com>2018-08-24 16:09:56 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2018-08-24 16:09:56 +0200
commitdde59ccbcdbeedace0ecd91577ceebcdf05b8c0e (patch)
treef2188057896c231b5b439545edae27b9dcdb3607 /wee_slack.py
parentcf9fdcf5fb40fc1acbc4efc85ad187e44087b0a1 (diff)
downloadwee-slack-dde59ccbcdbeedace0ecd91577ceebcdf05b8c0e.tar.gz
Colorize edits and reactions (#608)
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 1400354..dd5f39e 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2584,7 +2584,9 @@ def subprocess_message_changed(message_json, eventrouter, channel, team):
channel.change_message(new_message["ts"], message_json=new_message)
def subprocess_message_deleted(message_json, eventrouter, channel, team):
- channel.change_message(message_json["deleted_ts"], text="(deleted)")
+ message = "{}{}{}".format(
+ w.color("red"), '(deleted)', w.color("reset"))
+ channel.change_message(message_json["deleted_ts"], text=message)
def subprocess_channel_topic(message_json, eventrouter, channel, team):
@@ -2745,7 +2747,8 @@ def render(message_json, team, channel, force=False):
text = unfurl_refs(text)
if "edited" in message_json:
- text += " (edited)"
+ text += "{}{}{}".format(
+ w.color("095"), ' (edited)', w.color("reset"))
text += unfurl_refs(unwrap_attachments(message_json, text))
@@ -2967,9 +2970,10 @@ def create_user_status_string(profile):
def create_reaction_string(reactions):
count = 0
if not isinstance(reactions, list):
- reaction_string = " [{}]".format(reactions)
+ reaction_string = " {}[{}]{}".format(
+ w.color("darkgray"), reactions, w.color("reset"))
else:
- reaction_string = ' ['
+ reaction_string = ' {}['.format(w.color("darkgray"))
for r in reactions:
if len(r["users"]) > 0:
count += 1