twitch

package
v0.0.0-...-ae6a1b9 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventType_ChannelFollow = "channel.follow"
	EventType_StreamOnline  = "stream.online"
	EventType_StreamOffline = "stream.offline"
)

Event Types

View Source
const (
	SUBSCRIPTION_VERSION = "1"
	EVENT_SUB_URL        = "https://api.twitch.tv/helix/eventsub/subscriptions"
)
View Source
const (
	EventMethod_webhook = "webhook"
)

Event Methods

Variables

View Source
var (
	BASE_AUTH_URL  = "https://id.twitch.tv"
	AUTH_VERSION   = "oauth2"
	TOKEN_ENDPOINT = "token"

	BASE_API_URL           = "https://api.twitch.tv"
	API_VERSION            = "helix"
	USERS_ENDPOINT         = "users"
	FOLLOWS_ENDPOINT       = USERS_ENDPOINT + "/follows"
	GAMES_ENDPOINT         = "games"
	STREAMS_ENDPOINT       = "streams"
	CHANNELS_ENDPOINT      = "channels"
	EVENTSUB_ENDPOINT      = "eventsub"
	SUBSCRIPTIONS_ENDPOINT = "subscriptions"
)
View Source
var (
	BASE_SELF_API_URL    = "https://twitch.aybushbot.com/api"
	DEFAULT_SELF_API_VER = "v2"

	CURRENT_TWITCH_API_VER = 2
)

Functions

func NewApiV1

func NewApiV1(apiClient *ApiClient, userFollowsChan chan<- v1.UserFollows,
	streamChangedChan chan<- messages.StreamChanged) *apiV1

func NewApiV2

func NewApiV2(apiClient *ApiClient, userFollowsChan chan<- v1.UserFollows,
	streamChangedChan chan<- messages.StreamChanged) *apiV2

func NewServer

func NewServer(apiClient *ApiClient,
	userFollowsChan chan<- v1.UserFollows,
	streamChanged chan<- messages.StreamChanged,
	certFile string, keyFile string) *server

Types

type ApiClient

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

func NewApiClient

func NewApiClient(clientId string, clientSecret string, userRefreshToken string) *ApiClient

type ChatBot

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

func NewChatBot

func NewChatBot(username string, token string, streamer payloads.User, client *ApiClient, twitchRepository repository.TwitchRepository) *ChatBot

func (*ChatBot) Start

func (cb *ChatBot) Start()

func (*ChatBot) Stop

func (cb *ChatBot) Stop()

type Manager

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

func NewManager

func NewManager(streamerUsername string, clientSecret string, clientID string, userRefreshToken string,
	userFollowsChan chan<- v1.UserFollows,
	streamChangedChan chan<- messages.StreamChanged, hubSecretP string, twitchRepository repository.TwitchRepository,
	certFile string, keyFile string) *Manager

func (*Manager) IsRunning

func (man *Manager) IsRunning() bool

func (*Manager) Start

func (man *Manager) Start() error

func (*Manager) Stop

func (man *Manager) Stop()

type ReloadMessage

type ReloadMessage struct {
	ChatCommands          bool
	UserNoticeMessages    bool
	AutoBroadcastMessages bool
	BotMessages           bool
}

Directories

Path Synopsis
v1
v2

Jump to

Keyboard shortcuts

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