package slack
Install
Dune Dependency
Authors
Maintainers
Sources
md5=f3be3accbb3b77babbc9b672746c603b
sha512=e715aa318eee97c65d254e1a2b052fb08a8e113d11343272c03a13cccd2f74a480678e064bcb6c901624aadcb83d16eabadbd6caa9181465a920cb69aee8f644
doc/slack.lib/Slack_lib/Utils/index.html
Module Slack_lib.Utils
Source
val validate_signature :
?version:string ->
?signing_key:string ->
headers:(string * ExtLib.String.t) list ->
string ->
(unit, string) Slack_t.http_response
validate_signature signing_key headers body
validate the signature from a Slack event API hook.
val process_slack_notification :
Context.t ->
(string * ExtLib.String.t) list ->
string ->
notification_handler:
(Slack_t.event_callback_notification -> (string, string) result Lwt.t) ->
(string, string) result Lwt.t
process_slack_notification
is a general handling function for Slack event callback notification where it validates the signature of incoming hooks and then pass it to your notification_handler
to process the actual notification. It also has handlings for the URL verification challenge so to support that, you need to make sure your handler returns a string Lwt.t
(and you always should return 200s
code otherwise, Slack will retry).
val process_slack_event :
Context.t ->
(string * ExtLib.String.t) list ->
string ->
event_handler:(Slack_t.event -> (string, string) result Lwt.t) ->
(string, string) result Lwt.t
process_slack_event
is the same as process_slack_notification
but will disregard the notification detail and only process the notification event using your event_handler
.
conversation types of a Slack channel
val conversation_type_of_conversation :
Slack_t.conversation ->
(conversation_type, [> `Other of string ]) Slack_t.http_response
channel_type_of_conversation
returns a conversation_type
of a some conversation
API result
ApiHelpers Api_Impl
is a functor that wraps Api for simple functionalities such as sending texts