Fix workflows & apps sending to channel, slack you're inconsistent in a bad way.
This commit is contained in:
parent
d9ec6e5a3f
commit
49a4a4f780
1 changed files with 12 additions and 0 deletions
12
main.py
12
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])
|
||||
|
|
Loading…
Reference in a new issue