Documentation ¶
Index ¶
- Variables
- func ChatterCount() int
- func Chatters() map[string]struct{}
- func Client() (*helix.Client, error)
- func GenerateUserAccessToken(code string)
- func GetSubscribers()
- func RefreshUserAccessToken()
- func SetStreamTags()
- func UpdateChatters()
- func UpdateWebhookSubscriptions()
- func UserIsFollower(username string) bool
- func UserIsSubscriber(username string) bool
Constants ¶
This section is empty.
Variables ¶
var AppAccessToken string
var AuthToken string
var ChannelID string
ChannelID contains the twitch-internal user ID
var ClientID string
these are used to authenticate to twitch
var ClientSecret string
var UserAccessToken string
these are used to authenticate requests that require user permissions
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 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 ¶
UserIsFollower returns true if the user follows the channel
func UserIsSubscriber ¶
UserIsSubscriber returns true if the user subscribes to the channel
Types ¶
This section is empty.