webhooks

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendChatEvent

func SendChatEvent(chatEvent *events.UserMessageEvent)

SendChatEvent will send a chat event to webhook destinations.

func SendChatEventUserJoined

func SendChatEventUserJoined(event events.UserJoinedEvent)

SendChatEventUserJoined sends a webhook notifying that a user has joined.

func SendChatEventUsernameChanged

func SendChatEventUsernameChanged(event events.NameChangeEvent)

SendChatEventUsernameChanged will send a username changed event to webhook destinations.

func SendEventToWebhooks

func SendEventToWebhooks(payload WebhookEvent)

SendEventToWebhooks will send a single webhook event to all webhook destinations.

func SendStreamStatusEvent

func SendStreamStatusEvent(eventType models.EventType)

SendStreamStatusEvent will send all webhook destinations the current stream status.

Types

type WebhookChatMessage

type WebhookChatMessage struct {
	User      *user.User `json:"user,omitempty"`
	ClientID  uint       `json:"clientId,omitempty"`
	Body      string     `json:"body,omitempty"`
	RawBody   string     `json:"rawBody,omitempty"`
	ID        string     `json:"id,omitempty"`
	Visible   bool       `json:"visible"`
	Timestamp *time.Time `json:"timestamp,omitempty"`
}

WebhookChatMessage represents a single chat message sent as a webhook payload.

type WebhookEvent

type WebhookEvent struct {
	Type      models.EventType `json:"type"` // messageSent | userJoined | userNameChange
	EventData interface{}      `json:"eventData,omitempty"`
}

WebhookEvent represents an event sent as a webhook.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL