Skip to content

Commit b6ebeed

Browse files
committed
fix slack upload
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
1 parent d75db02 commit b6ebeed

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

chaosslack/control.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import os
33
import platform
4-
from secrets import token_hex
54
from typing import Any, Dict, List, Optional
65

76
import yaml
@@ -311,14 +310,15 @@ def send(
311310
),
312311
)
313312
elif in_thread and thread_data:
313+
state_content = yaml.safe_dump(thread_data or {}, indent=2)
314314
r = client.files_upload_v2(
315-
filename=f"{token_hex(8)}.yaml",
316-
channels=channel,
315+
channel=current_msg.get("channel"),
317316
thread_ts=current_msg.get("ts"),
318317
initial_comment=message,
319-
content=yaml.safe_dump(thread_data or {}, indent=2),
318+
snippet_type="yaml",
319+
content=state_content,
320+
length=len(state_content),
320321
title="state.yaml",
321-
filetype="yaml",
322322
)
323323
elif in_thread:
324324
r = client.chat_postMessage(

0 commit comments

Comments
 (0)