twitch

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppAccessToken string
View Source
var AuthToken string
View Source
var ChannelID string

ChannelID contains the twitch-internal user ID

View Source
var ClientID string

these are used to authenticate to twitch

View Source
var ClientSecret string
View Source
var UserAccessToken string

these are used to authenticate requests that require user permissions

View Source
var UserRefreshToken string

Functions

func ChatterCount

func ChatterCount() int

ChatterCount returns the number of chatters (as reported by Twitch)

func Chatters

func Chatters() map[string]struct{}

Chatters returns a map where the keys are current chatters we use an empty struct for performance reasons c.p. https://stackoverflow.com/a/10486196 TODO: consider using an int as the value and have that be the ID in the DB

func Client

func Client() (*helix.Client, error)

Client creates a twitch client, or returns the existing one

func GenerateUserAccessToken

func GenerateUserAccessToken(code string)

GenerateUserAccessToken sends a code to Twitch to generate a user access token. This is called by the web server after going through the OAuth flow

func GetSubscribers

func GetSubscribers()

GetSubscribers pulls down the most recent list of subscribers

func RefreshUserAccessToken

func RefreshUserAccessToken()

RefreshUserAccessToken makes a call to Twitch to generate a fresh user access token. It requires a UserRefreshToken to be set already.

func SetStreamTags

func SetStreamTags()

SetStreamTags will call a shell script (lol) to set stream tags TODO: use the twitch API instead of a shell script when possible

func UpdateChatters

func UpdateChatters()

UpdateChatters makes a request to the chatters API and updates currentChatters

func UpdateWebhookSubscriptions

func UpdateWebhookSubscriptions()

UpdateWebhookSubscriptions will create new webhook subscriptions

func UserIsFollower

func UserIsFollower(username string) bool

UserIsFollower returns true if the user follows the channel

func UserIsSubscriber

func UserIsSubscriber(username string) bool

UserIsSubscriber returns true if the user subscribes to the channel

Types

This section is empty.

Jump to

Keyboard shortcuts

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