Documentation ¶
Index ¶
- type EventsubClient
- func (c *EventsubClient) ClearSubscriptions() error
- func (c *EventsubClient) CreateSubscription(condition interface{}) (*messages.SubscriptionRequestStatus, error)
- func (c *EventsubClient) DeleteSubscription(subscriptionID string) error
- func (c *EventsubClient) GetBroadcaster(urlOrName string) (*restclient.TwitchUser, error)
- func (c *EventsubClient) GetStreams(filters restclient.GetStreamsOpts) ([]restclient.TwitchStream, error)
- func (c *EventsubClient) GetUsers(ids, names []string) ([]restclient.TwitchUser, error)
- func (c *EventsubClient) RegisterHandler(handler interface{})
- func (c *EventsubClient) Subscriptions(filters restclient.SubscriptionsParams) chan restclient.SubscriptionResult
- type NazunaOpts
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 ¶
func (c *EventsubClient) GetStreams(filters restclient.GetStreamsOpts) ([]restclient.TwitchStream, error)
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 ¶
func (c *EventsubClient) Subscriptions(filters restclient.SubscriptionsParams) chan restclient.SubscriptionResult
Subscriptions returns a list of EventSub subscriptions registered to this client which match the provided filters