[{"name":"Matrix.Webhooks","comment":" The MatrixWebhooks module connects to the Matrix-Webhook API.\n\n\n# Webhook\n\nFirst, you'll set up a configuration to connect to a webhook.\n\n@docs Webhook, toWebhook\n\n\n# Sending messages\n\n@docs sendMessage, sendRaw\n\n\n# Catching errors\n\n@docs Error\n\n","unions":[{"name":"Error","comment":" Sometimes the webhook request fails, and you'd like to know why.\nThe error type explains more about why a request may have failed:\n\n  - `BadUrl` means the provided url was formed badly.\n  - `HomeserverReturnedError` means the homeserver refuses to send the message, returning a status code and an error message.\n  - `HomeserverTimeoutError` means the homeserver takes too long to respond to the webhook.\n  - `NetworkError` means that something went wrong with the connection. The user may have entered a cave or shut off their WiFi.\n  - `NotJoinedToRoom` means that the user is not part of the room and that the webhook is unable to join the room.\n  - `Unauthorized` means that an invalid Webhook API key was provided.\n  - `WebhookMissingInput` means that the Webhook API requires an unknown input. This may happen if a future version requires a certain value that the API does not specify yet.\n  - `WebhookReturnedInvalidJSON` means that the Webhook API returned invalid or unexpected JSON objects.\n  - `WehookTimeoutError` means that the Webhook API takes too long to respond.\n\n","args":[],"cases":[["BadUrl",["String.String"]],["HomeserverReturnedError",["Basics.Int","String.String"]],["HomeserverTimeoutError",[]],["NetworkError",[]],["NotJoinedToRoom",[]],["Unauthorized",[]],["WebhookMissingInput",[]],["WebhookReturnedInvalidJSON",[]],["WebhookTimeoutError",[]]]}],"aliases":[{"name":"Webhook","comment":" Webhook that can be connected to.\n","args":[],"type":"Internal.WebhookToken"}],"values":[{"name":"sendMessage","comment":" Send a message to the webhook. The message supports Markdown.\n\n    sendMessage : Cmd msg\n    sendMessage toMsg webhook \"hi mom!\"\n\nIt is recommended to use this function to make a smaller one and focus on sending the messages.\n\n    send : String -> Cmd msg\n    send = sendMessage toMsg webhook\n\n    -- These all send a message to the Matrix-Webhook API\n    send \"hi mom!\"\n    send \"I am a **big** adult now.\"\n    send \"Are you proud of me? :)\"\n\n","type":"(Result.Result Matrix.Webhooks.Error () -> msg) -> Matrix.Webhooks.Webhook -> String.String -> Platform.Cmd.Cmd msg"},{"name":"sendRaw","comment":" The previous message is all nicely set up, but some people prefer a simple function where you can insert all your data right away.\nThis function is relatively careless, allowing you to send message to the Webhook API and only getting a `Bool` in return that lets you know whether the message was sent successfully.\n\n    type Msg = Success Bool\n\n    sendRaw\n        Success\n        \"https://example.com\"\n        \"your-secret-api-key\"\n        \"!abcdef:example.org\"\n        \"hi mom!\"\n    == sendMessage toMsg webhook \"hi mom!\"\n\n**Note:** If the function returns `False`, there is no way of finding out why it went wrong.\n\n","type":"(Basics.Bool -> msg) -> String.String -> String.String -> String.String -> String.String -> Platform.Cmd.Cmd msg"},{"name":"toWebhook","comment":" You can configure access to the webhook using this function.\n\n    webhook : Webhook\n    webhook =\n        toWebhook\n            \"https://example.com\"\n            \"your-secret-api-key\"\n            \"!abcdef:example.org\"\n\n","type":"String.String -> String.String -> String.String -> Matrix.Webhooks.Webhook"}],"binops":[]}]