From 7abe0786fb020e03fe4d5e67709223c0a6e7f90d Mon Sep 17 00:00:00 2001 From: TAKANO Mitsuhiro Date: Sun, 18 Feb 2024 11:11:11 +0900 Subject: [PATCH] message['events'][0]['message'] valeus are `str` --- sun.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sun.py b/sun.py index ae5d992..e16c371 100755 --- a/sun.py +++ b/sun.py @@ -1351,11 +1351,11 @@ def parse_slack_outgoing_webhooks(self, http_body): self.message["events"][0]["message"] = {} self.message["events"][0]["message"]["id"] = -1 self.message["events"][0]["message"]["type"] = "user" - self.message["events"][0]["message"]["speaker_id"] = params.get("user_name") - self.message["events"][0]["message"]["nickname"] = params.get("user_name") - self.message["events"][0]["message"]["text"] = params.get("text") - self.message["events"][0]["message"]["room"] = params.get("team_domain") - self.message["events"][0]["message"]["slack_channel"] = params.get("channel_name") # extra + self.message["events"][0]["message"]["speaker_id"] = str(params.get("user_name")) + self.message["events"][0]["message"]["nickname"] = str(params.get("user_name")) + self.message["events"][0]["message"]["text"] = str(params.get("text")) + self.message["events"][0]["message"]["room"] = str(params.get("team_domain")) + self.message["events"][0]["message"]["slack_channel"] = str(params.get("channel_name")) # extra d = datetime.datetime.fromtimestamp(float(params.get("timestamp"))).isoformat() self.message["events"][0]["message"]["timestamp"] = d + 'Z'