twitch

package
v0.0.0-...-e1f0078 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChannelID

func GetChannelID(token, clientID string) (string, error)

GetChannelID retrieves the channel ID for the OAuth token provided, and returns it as a string

func GetOAuthToken

func GetOAuthToken(clientID string) string

GetOAuthToken gets a User OAuth Token from the Twitch API and returns it as a string. This function needs further work: it is not fully automated, requiring user involvement (which also has an ugly UX)

func ListenChannelPoints

func ListenChannelPoints(chanID, clientID, oauthToken string, callback func(Redemption))

ListenChannelPoints starts a WebSocket listening to the Twitch PubSub API for Channel Point redemptions, which calls callback with the provided file handle and the reward title as a string

Types

type Redemption

type Redemption struct {
	ID         string    `json:"id"`
	User       user      `json:"user"`
	ChannelID  string    `json:"channel_id"`
	RedeemedAt time.Time `json:"redeemed_at"`
	Reward     reward    `json:"reward"`
	UserInput  string    `json:"user_input"`
	Status     string    `json:"status"`
}

Redemption represents a Channel Point reward redemption on Twitch.

Jump to

Keyboard shortcuts

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