From 49a4a4f780bbba03eae38fc821f4774f875c843e Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Sat, 14 Dec 2024 23:00:03 -0600 Subject: [PATCH] Fix workflows & apps sending to channel, slack you're inconsistent in a bad way. --- main.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.py b/main.py index d977436..e81bb2c 100644 --- a/main.py +++ b/main.py @@ -107,6 +107,18 @@ if __name__ == "__main__": "[INFO] Building messages, this might take a little bit..." ) for i in range(len(messages)): + if not messages[i].get("user") and messages[i].get( + "username" + ): # Workflows don't have a userid, obviously + messages[i][ + "user" + ] = f'{messages[i].get("username")}|WORKFLOW' + if not messages[i].get("user") and messages[i].get( + "subtype" + ): # Apps sending to channel also don't... + messages[i]["user"] = messages[i]["root"][ + "user" + ] # This is probably technically wrong, but I don't care. label = f'[{messages[i]["ts"]}] <@{messages[i]["user"]}>: {messages[i]["text"]}' for user in userMappings: label = label.replace(user, userMappings[user])