diff --git a/slackpost.py b/slackpost.py index f7cde12..d487d1f 100755 --- a/slackpost.py +++ b/slackpost.py @@ -26,10 +26,12 @@ if addr.replace(".", "") != slack.user().email().replace(".", ""): if headers.is_multipart(): for part in headers.get_payload(): if part.get_content_type() == "text/plain": - payload = part.get_payload() + payload = part.get_payload(decode = True) else: - payload = headers.get_payload() + payload = headers.get_payload(decode = True) +if type(payload) is bytes: + payload = payload.decode() # # Find the thread id in the message payload