From 18aa2a53759b4b64151ebe16219f45a2e6644932 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Wed, 16 Nov 2016 14:54:37 -0500 Subject: [PATCH] Split posts on newline Slack lets you write posts with multiple paragraphs. We were joining everything together, but I think preserving the original newlines will make things more readable. Signed-off-by: Anna Schumaker --- slack/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack/chat.py b/slack/chat.py index 6a1ec70..a468ce1 100644 --- a/slack/chat.py +++ b/slack/chat.py @@ -47,7 +47,7 @@ class Message: self.__ts = json["ts"] self.__time = datetime.fromtimestamp(float(self.__ts)) self.__user = users.info(json.get("user", None)) - self.__text = [ json["text"].encode("utf-8").decode(errors="replace")] + self.__text = json["text"].encode("utf-8").decode(errors="replace").split("\n") def __lt__(self, other): return self.__time < other.__time