random commit
This commit is contained in:
@@ -44,8 +44,8 @@ func (c *Client) GetUserID(login string) (string, error) {
|
|||||||
return resp.Data.Users[0].ID, nil
|
return resp.Data.Users[0].ID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStreamInfo(client *helix.Client, userID string) (*helix.Stream, error) {
|
func (c *Client) GetStreamInfo(userID string) (*helix.Stream, error) {
|
||||||
resp, err := client.GetStreams(&helix.StreamsParams{
|
rep, err := c.api.GetStreams(&helix.StreamsParams{
|
||||||
UserIDs: []string{userID},
|
UserIDs: []string{userID},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -57,12 +57,12 @@ func getStreamInfo(client *helix.Client, userID string) (*helix.Stream, error) {
|
|||||||
return &resp.Data.Streams[0], nil
|
return &resp.Data.Streams[0], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStreamUptime(client *helix.Client, channel string) (string, error) {
|
func (c *Client) GetStreamUptime(channel string) (string, error) {
|
||||||
userID, err := GetUserID(client, channel)
|
userID, err := c.GetUserId(channel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
stream, err := getStreamInfo(client, userID)
|
stream, err := c.GetStreamInfo(userID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@@ -72,12 +72,12 @@ func getStreamUptime(client *helix.Client, channel string) (string, error) {
|
|||||||
return uptime.String(), nil
|
return uptime.String(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStreamTitle(client *helix.Client, channel string) (string, error) {
|
func (c *Client) GetStreamTitle(channel string) (string, error) {
|
||||||
userID, err := GetUserID(client, channel)
|
userID, err := C. GetUserID(channel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
resp, err := client.GetChannelInformation(&helix.GetChannelInformationParams{
|
resp, err := c.api.GetChannelInformation(&helix.GetChannelInformationParams{
|
||||||
BroadcasterID: userID,
|
BroadcasterID: userID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -89,24 +89,24 @@ func getStreamTitle(client *helix.Client, channel string) (string, error) {
|
|||||||
return resp.Data.Channels[0].Title, nil
|
return resp.Data.Channels[0].Title, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func setStreamTitle(client *helix.Client, channel, newTitle string) error {
|
func (c *Client) SetStreamTitle(channel, newTitle string) error {
|
||||||
userID, err := GetUserID(client, channel)
|
userID, err := c.GetUserID(channel)
|
||||||
if err!= nil {
|
if err!= nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_, err = client.EditChannelInformation(&helix.EditChannelInformationParams {
|
_, err = c.api.EditChannelInformation(&helix.EditChannelInformationParams {
|
||||||
BroadcasterID: userID,
|
BroadcasterID: userID,
|
||||||
Title: newTitle,
|
Title: newTitle,
|
||||||
})
|
})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStreamCategory(client *helix.Client, channel string) (string, error) {
|
func (c *Client) GetStreamCategory(channel string) (string, error) {
|
||||||
userID, err := GetUserID(client, channel)
|
userID, err := c.GetUserID(channel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
resp, err := client.GetChannelInformation(&helix.GetChannelInformationParams{
|
resp, err := c.api.GetChannelInformation(&helix.GetChannelInformationParams{
|
||||||
BroadcasterID: userID,
|
BroadcasterID: userID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user