nazuna

package module
v0.0.0-...-d3be85b Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventsubClient

type EventsubClient struct {
	// contains filtered or unexported fields
}

EventsubClient contains both the REST client and the webhook server required for communication with the Twitch API

func NewClient

func NewClient(opts NazunaOpts) (*EventsubClient, error)

NewClient creates a new EventSubClient

func (*EventsubClient) ClearSubscriptions

func (c *EventsubClient) ClearSubscriptions() error

ClearSubscriptions unsubscribes from all EventSub subscriptions

func (*EventsubClient) CreateSubscription

func (c *EventsubClient) CreateSubscription(condition interface{}) (*messages.SubscriptionRequestStatus, error)

CreateSubscription creates a new EventSub subscription for the provided event condition

func (*EventsubClient) DeleteSubscription

func (c *EventsubClient) DeleteSubscription(subscriptionID string) error

DeleteSubscription unsubscribes from the EventSub subscription corresponding to the provided ID

func (*EventsubClient) GetBroadcaster

func (c *EventsubClient) GetBroadcaster(urlOrName string) (*restclient.TwitchUser, error)

GetBroadcaster looks up a twitch user by either their name or channel url.

func (*EventsubClient) GetStreams

GetStreams takes a set of query options and returns a slice of matching twitchstreams

func (*EventsubClient) GetUsers

func (c *EventsubClient) GetUsers(ids, names []string) ([]restclient.TwitchUser, error)

GetUsers returns a list of users who correspond to the provided user IDs or names

func (*EventsubClient) RegisterHandler

func (c *EventsubClient) RegisterHandler(handler interface{})

RegisterHandler adds a handler function to the handlers slice

func (*EventsubClient) Subscriptions

Subscriptions returns a list of EventSub subscriptions registered to this client which match the provided filters

type NazunaOpts

type NazunaOpts struct {
	WebhookPath    string
	ListenOn       string
	ClientID       string
	ClientSecret   string
	Scopes         []string
	Secret         string
	ServerHostname string
	Permissive     bool
}

NazunaOpts contains the required options to set up a twitch client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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