Include the workflow user ID when trying to open a DM, workflow can't send there otherwise

This commit is contained in:
Firepup Sixfifty 2025-01-31 12:16:58 -06:00
parent 517d3b79a2
commit 62efd30a28
Signed by: Firepup650
SSH key fingerprint: SHA256:cb8sEJwc0kQJ6/nMUhscWRe35itf0NFMdSKl3v4qt48

View file

@ -27,9 +27,8 @@ def useridToChannel(
inputs: dict, fail: Fail, complete: Complete, logger: logging.Logger
):
try:
user_id = inputs["user_id"]
log(user_id, "DEBUG")
channel_id = client.conversations_open(users=user_id)["channel"]["id"]
ids = [inputs["user_id"], inputs["workflow_id"]]
channel_id = client.conversations_open(users=ids)["channel"]["id"]
complete({"channel_id": channel_id})
except:
log(format_exc(), "ERROR")