Vik.Webhook (Vik v0.0.1-rc1)

View Source

Handler for integrating Vik into 3rd-party software using (optional) webhooks.

Usage

To utilize this functionality, export the DEFAULT_WEBHOOK variable in your system's environment:

export DEFAULT_WEBHOOK="https://discord.com/api/webhooks/..."

Available webhooks

  • DEFAULT_WEBHOOK receives messages for all events.
  • LOGGER_WEBHOOK receives only logger.message events.
  • SCRY_WEBHOOK receives only shard.save events.

Summary

Types

Implemented events

Payload sent to the configured endpoint.

Functions

Sends a message to a user-defined webhook.

Types

event()

@type event() :: binary()

Implemented events:

  • shard.save
  • shard.deploy
  • logger.message

payload()

@type payload() :: %{event: event(), content: term()}

Payload sent to the configured endpoint.

Functions

push(event, data)

@spec push(event(), term()) :: :ok

Sends a message to a user-defined webhook.

The configured endpoint receives JSON data, as defined by payload/0:

{"event": "shard.save", "content": ... }