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 ¶ added in v0.2.0
type ChatEvent struct { Data ChatEventData `json:"data"` RequestID string `json:"request_id"` Type string `json:"type"` }
type ChatEventBlock ¶ added in v0.2.0
type ChatEventBlock struct { Data ChatEventBlockData `json:"data"` Type string `json:"type"` }
type ChatEventBlockData ¶ added in v0.2.0
type ChatEventBlockData struct {
Text string `json:"text"`
}
type ChatEventChannel ¶ added in v0.2.0
type ChatEventData ¶ added in v0.2.0
type ChatEventData struct { Channels []ChatEventChannel `json:"channels"` Messages []ChatEventMessage `json:"messages"` Users []ChatEventUser `json:"users"` }
type ChatEventDataNoChannels ¶ added in v0.2.0
type ChatEventDataNoChannels struct { // TODO: change [][]string to [][]any and test Channels [][]string `json:"channels"` Messages []ChatEventMessage `json:"messages"` Users []ChatEventUser `json:"users"` }
type ChatEventMessage ¶ added in v0.2.0
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 ¶ added in v0.2.0
type ChatEventNoChannels struct { Data ChatEventDataNoChannels `json:"data"` RequestID string `json:"request_id"` Type string `json:"type"` }
type ChatEventNotification ¶ added in v0.9.0
type ChatEventRaidNotification ¶ added in v0.9.0
type ChatEventRaidNotification struct {
StartTs int64 `json:"start_ts"`
}
type ChatEventRant ¶ added in v0.2.0
type ChatEventUser ¶ added in v0.2.0
type ChatInfo ¶
func (*ChatInfo) MessageUrl ¶ added in v0.2.0
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 ¶ added in v0.2.0
type ChatStream struct {
// contains filtered or unexported fields
}
type Client ¶
func NewClient ¶
func NewClient(opts NewClientOptions) (*Client, error)
func (*Client) LoggedIn ¶ added in v0.3.0
func (c *Client) LoggedIn() (*LoggedInResponse, error)
func (*Client) PrintCookies ¶
func (*Client) Request ¶
func (c *Client) Request() (*LivestreamResponse, error)
func (*Client) StartChatStream ¶ added in v0.2.0
func (*Client) StopChatStream ¶ added in v0.2.0
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 ¶ added in v0.3.1
type LoggedInResponse struct { Data LoggedInResponseData `json:"data"` User LoggedInResponseUser `json:"user"` }
type LoggedInResponseData ¶ added in v0.8.0
type LoggedInResponseData struct {
Username string `json:"username"`
}
type LoggedInResponseUser ¶ added in v0.3.1
type LoginResponseBool ¶
type LoginResponseBool struct {
Data DataBool `json:"data"`
}
type LoginResponseString ¶
type LoginResponseString struct {
Data DataString `json:"data"`
}
type NewClientOptions ¶ added in v0.3.0
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.