Documentation
¶
Index ¶
- Constants
- type Badge
- type Categories
- type Category
- type Chat
- type ChatData
- type ChatEvent
- type ChatEventBlock
- type ChatEventBlockData
- type ChatEventChannel
- type ChatEventData
- type ChatEventDataNoChannels
- type ChatEventMessage
- type ChatEventNoChannels
- type ChatEventNotification
- type ChatEventRaidNotification
- type ChatEventRant
- type ChatEventUser
- type ChatInfo
- type ChatMessage
- type ChatRequest
- type ChatResponse
- type ChatStream
- type ChatView
- type Client
- func (c *Client) Chat(message string, channelID *int) error
- func (c *Client) ChatInfo(reload bool) (*ChatInfo, error)
- func (c *Client) LoggedIn() (*LoggedInResponse, error)
- func (c *Client) Login(username string, password string) ([]*http.Cookie, error)
- func (c *Client) Logout() error
- func (c *Client) PrintCookies() error
- func (c *Client) Request() (*LivestreamResponse, error)
- func (c *Client) StartChatStream(handle func(cv ChatView), handleError func(err error)) error
- func (c *Client) StopChatStream()
- type DataBool
- type DataString
- type Error
- type Follower
- type Followers
- type GetSaltsData
- type GetSaltsResponse
- type Livestream
- type LivestreamResponse
- type LoggedInResponse
- type LoggedInResponseData
- type LoggedInResponseUser
- type LoginResponseBool
- type LoginResponseString
- type Message
- type NewClientOptions
- type Rant
- type Subscriber
- type Subscribers
Constants ¶
View Source
const ( ChatBadgeRecurringSubscription = "recurring_subscription" ChatBadgeLocalsSupporter = "locals_supporter" ChatTypeInit = "init" ChatTypeMessages = "messages" ChatTypeMuteUsers = "mute_users" ChatTypeDeleteMessages = "delete_messages" ChatTypeSubscriber = "locals_supporter" ChatTypeRaiding = "raid_confirmed" ChatTypePinMessage = "pin_message" ChatTypeUnpinMessage = "unpin_message" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Categories ¶
type ChatData ¶
type ChatData struct {
RequestID string `json:"request_id"`
Message ChatMessage `json:"message"`
Rant *string `json:"rant"`
ChannelID *int `json:"channel_id"`
}
type ChatEvent ¶
type ChatEvent struct {
Data ChatEventData `json:"data"`
RequestID string `json:"request_id"`
Type string `json:"type"`
}
type ChatEventBlock ¶
type ChatEventBlock struct {
Data ChatEventBlockData `json:"data"`
Type string `json:"type"`
}
type ChatEventBlockData ¶
type ChatEventBlockData struct {
Text string `json:"text"`
}
type ChatEventChannel ¶
type ChatEventData ¶
type ChatEventData struct {
Channels []ChatEventChannel `json:"channels"`
Messages []ChatEventMessage `json:"messages"`
Users []ChatEventUser `json:"users"`
}
type ChatEventDataNoChannels ¶
type ChatEventDataNoChannels struct {
// TODO: change [][]string to [][]any and test
Channels [][]string `json:"channels"`
Messages []ChatEventMessage `json:"messages"`
Users []ChatEventUser `json:"users"`
}
type ChatEventMessage ¶
type ChatEventMessage struct {
Blocks []ChatEventBlock `json:"blocks"`
ChannelID *int64 `json:"channel_id"`
ID string `json:"id"`
Notification *ChatEventNotification `json:"notification"`
RaidNotification *ChatEventRaidNotification `json:"raid_notification"`
Rant *ChatEventRant `json:"rant"`
Text string `json:"text"`
Time string `json:"time"`
UserID string `json:"user_id"`
}
type ChatEventNoChannels ¶
type ChatEventNoChannels struct {
Data ChatEventDataNoChannels `json:"data"`
RequestID string `json:"request_id"`
Type string `json:"type"`
}
type ChatEventNotification ¶
type ChatEventRaidNotification ¶
type ChatEventRaidNotification struct {
StartTs int64 `json:"start_ts"`
}
type ChatEventRant ¶
type ChatEventUser ¶
type ChatInfo ¶
func (*ChatInfo) MessageUrl ¶
type ChatMessage ¶
type ChatMessage struct {
Text string `json:"text"`
}
type ChatRequest ¶
type ChatRequest struct {
Data ChatData `json:"data"`
}
type ChatResponse ¶
type ChatResponse struct {
Errors []Error `json:"errors"`
}
type ChatStream ¶
type ChatStream struct {
// contains filtered or unexported fields
}
type Client ¶
func NewClient ¶
func NewClient(opts NewClientOptions) (*Client, error)
func (*Client) LoggedIn ¶
func (c *Client) LoggedIn() (*LoggedInResponse, error)
func (*Client) PrintCookies ¶
func (*Client) Request ¶
func (c *Client) Request() (*LivestreamResponse, error)
func (*Client) StartChatStream ¶
func (*Client) StopChatStream ¶
func (c *Client) StopChatStream()
type DataString ¶
type DataString struct {
Session string `json:"session"`
}
type GetSaltsData ¶
type GetSaltsData struct {
Salts []string `json:"salts"`
}
type GetSaltsResponse ¶
type GetSaltsResponse struct {
Data GetSaltsData `json:"data"`
}
type Livestream ¶
type Livestream struct {
ID string `json:"id"`
Title string `json:"title"`
CreatedOn string `json:"created_on"`
IsLive bool `json:"is_live"`
Categories Categories `json:"categories"`
StreamKey string `json:"stream_key"`
Likes int64 `json:"likes"`
Dislikes int64 `json:"dislikes"`
WatchingNow int64 `json:"watching_now"`
Chat Chat `json:"chat"`
}
type LivestreamResponse ¶
type LivestreamResponse struct {
Now int64 `json:"now"`
Type string `json:"type"`
UserID string `json:"user_id"`
Username string `json:"username"`
ChannelID int64 `json:"channel_id"`
ChannelName string `json:"channel_name"`
MaxNumResults int64 `json:"max_num_results"`
Followers Followers `json:"followers"`
Subscribers Subscribers `json:"subscribers"`
Livestreams []Livestream `json:"livestreams"`
}
type LoggedInResponse ¶
type LoggedInResponse struct {
Data LoggedInResponseData `json:"data"`
User LoggedInResponseUser `json:"user"`
}
type LoggedInResponseData ¶
type LoggedInResponseData struct {
Username string `json:"username"`
}
type LoggedInResponseUser ¶
type LoginResponseBool ¶
type LoginResponseBool struct {
Data DataBool `json:"data"`
}
type LoginResponseString ¶
type LoginResponseString struct {
Data DataString `json:"data"`
}
type NewClientOptions ¶
type Subscriber ¶
type Subscribers ¶
type Subscribers struct {
NumSubscribers int64 `json:"num_subscribers"`
LatestSubscriber Subscriber `json:"latest_subscriber"`
RecentSubscribers []Subscriber `json:"recent_subscribers"`
}
Click to show internal directories.
Click to hide internal directories.