File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,12 @@ module Slack : Api.Slack = struct
77
77
let build_query_error url e = build_error @@ sprintf " error while querying %s: %s" url e in
78
78
let secrets = Context. get_secrets_exn ctx in
79
79
let headers, url, webhook_mode =
80
+ match Context. hook_of_channel ctx msg.channel with
81
+ | Some url -> [] , Some url, true
82
+ | None ->
80
83
match secrets.slack_access_token with
81
84
| Some access_token -> [ bearer_token_header access_token ], Some " https://slack.com/api/chat.postMessage" , false
82
- | None -> [] , Context. hook_of_channel ctx msg.channel, true
85
+ | None -> [] , None , false
83
86
in
84
87
match url with
85
88
| None -> Lwt. return @@ build_error @@ sprintf " no token or webhook configured to notify channel %s" msg.channel
You can’t perform that action at this time.
0 commit comments