Documentation
¶
Overview ¶
Package api provides a client for the Twitch API.
Index ¶
- Constants
- func CodeOf(err error) int
- type AdSchedule
- type AdScheduleListCall
- type AdScheduleListResponse
- type AdsResource
- type AdsSnoozeResource
- type AdsSnoozed
- type AnalyticsExtensionsResource
- type AnalyticsGamesResource
- type AnalyticsResource
- type Authorization
- type AuthorizationListCall
- type AuthorizationListResponse
- type AutoModSettings
- type AutoModStatus
- type BanUserInsertCall
- func (api *BanUserInsertCall) Ban(ban OutboundBan) *BanUserInsertCall
- func (api *BanUserInsertCall) BroadcasterID(broadcasterID string) *BanUserInsertCall
- func (api *BanUserInsertCall) Do(ctx context.Context, opts ...RequestOption) (*BanUserInsertResponse, error)
- func (api *BanUserInsertCall) ModeratorID(moderatorID string) *BanUserInsertCall
- type BanUserInsertResponse
- type BannedUser
- type BitsCheermotesListCall
- type BitsCheermotesListResponse
- type BitsCheermotesResource
- type BitsExtensionTransactionsListCall
- func (api *BitsExtensionTransactionsListCall) After(after string) *BitsExtensionTransactionsListCall
- func (api *BitsExtensionTransactionsListCall) Do(ctx context.Context, opts ...RequestOption) (*BitsExtensionTransactionsListResponse, error)
- func (api *BitsExtensionTransactionsListCall) ExtensionID(extensionID string) *BitsExtensionTransactionsListCall
- func (api *BitsExtensionTransactionsListCall) First(first int) *BitsExtensionTransactionsListCall
- func (api *BitsExtensionTransactionsListCall) ID(ids ...string) *BitsExtensionTransactionsListCall
- type BitsExtensionTransactionsListResponse
- type BitsExtensionsResource
- type BitsLeaderboardEntry
- type BitsLeaderboardListCall
- func (api *BitsLeaderboardListCall) Count(count int) *BitsLeaderboardListCall
- func (api *BitsLeaderboardListCall) Do(ctx context.Context, opts ...RequestOption) (*BitsLeaderboardListResponse, error)
- func (api *BitsLeaderboardListCall) Period(period string) *BitsLeaderboardListCall
- func (api *BitsLeaderboardListCall) StartedAt(startedAt time.Time) *BitsLeaderboardListCall
- func (api *BitsLeaderboardListCall) UserID(userID string) *BitsLeaderboardListCall
- type BitsLeaderboardListResponse
- type BitsLeaderboardResource
- type BitsResource
- type BlockedTerm
- type BroadcasterSubscriptionsListCall
- func (api *BroadcasterSubscriptionsListCall) After(after string) *BroadcasterSubscriptionsListCall
- func (api *BroadcasterSubscriptionsListCall) Before(before string) *BroadcasterSubscriptionsListCall
- func (api *BroadcasterSubscriptionsListCall) BroadcasterID(broadcasterID string) *BroadcasterSubscriptionsListCall
- func (api *BroadcasterSubscriptionsListCall) Do(ctx context.Context, opts ...RequestOption) (*BroadcasterSubscriptionsListResponse, error)
- func (api *BroadcasterSubscriptionsListCall) First(first int) *BroadcasterSubscriptionsListCall
- func (api *BroadcasterSubscriptionsListCall) UserID(userIDs ...string) *BroadcasterSubscriptionsListCall
- type BroadcasterSubscriptionsListResponse
- type CategorySearchResult
- type Channel
- type ChannelChatBadgesListCall
- type ChannelChatBadgesListResponse
- type ChannelContentClassificationLabel
- type ChannelEditor
- type ChannelEditorsListCall
- type ChannelEditorsListResponse
- type ChannelEmotesListCall
- type ChannelEmotesListResponse
- type ChannelFollowersListCall
- func (api *ChannelFollowersListCall) After(after string) *ChannelFollowersListCall
- func (api *ChannelFollowersListCall) BroadcasterID(broadcasterID string) *ChannelFollowersListCall
- func (api *ChannelFollowersListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelFollowersListResponse, error)
- func (api *ChannelFollowersListCall) First(first int) *ChannelFollowersListCall
- func (api *ChannelFollowersListCall) UserID(userID string) *ChannelFollowersListCall
- type ChannelFollowersListResponse
- type ChannelGuestStarSettings
- type ChannelInformationListCall
- type ChannelInformationListResponse
- type ChannelInformationModifyCall
- func (api *ChannelInformationModifyCall) BroadcasterID(broadcasterID string) *ChannelInformationModifyCall
- func (api *ChannelInformationModifyCall) BroadcasterLanguage(broadcasterLanguage string) *ChannelInformationModifyCall
- func (api *ChannelInformationModifyCall) ContentClassificationLabels(contentClassificationLabelss ...ChannelContentClassificationLabel) *ChannelInformationModifyCall
- func (api *ChannelInformationModifyCall) Delay(delay int) *ChannelInformationModifyCall
- func (api *ChannelInformationModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelInformationModifyResponse, error)
- func (api *ChannelInformationModifyCall) GameID(gameID string) *ChannelInformationModifyCall
- func (api *ChannelInformationModifyCall) IsBrandedContent(isBrandedContent bool) *ChannelInformationModifyCall
- func (api *ChannelInformationModifyCall) Tags(tagss ...string) *ChannelInformationModifyCall
- func (api *ChannelInformationModifyCall) Title(title string) *ChannelInformationModifyCall
- type ChannelInformationModifyResponse
- type ChannelPointRedemptionsListCall
- func (api *ChannelPointRedemptionsListCall) After(after string) *ChannelPointRedemptionsListCall
- func (api *ChannelPointRedemptionsListCall) BroadcasterID(broadcasterID string) *ChannelPointRedemptionsListCall
- func (api *ChannelPointRedemptionsListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRedemptionsListResponse, error)
- func (api *ChannelPointRedemptionsListCall) First(first int) *ChannelPointRedemptionsListCall
- func (api *ChannelPointRedemptionsListCall) ID(id string) *ChannelPointRedemptionsListCall
- func (api *ChannelPointRedemptionsListCall) RewardID(rewardID string) *ChannelPointRedemptionsListCall
- func (api *ChannelPointRedemptionsListCall) Sort(sort string) *ChannelPointRedemptionsListCall
- func (api *ChannelPointRedemptionsListCall) Status(status string) *ChannelPointRedemptionsListCall
- type ChannelPointRedemptionsListResponse
- type ChannelPointRedemptionsModifyCall
- func (api *ChannelPointRedemptionsModifyCall) BroadcasterID(broadcasterID string) *ChannelPointRedemptionsModifyCall
- func (api *ChannelPointRedemptionsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRedemptionsModifyResponse, error)
- func (api *ChannelPointRedemptionsModifyCall) ID(ids ...string) *ChannelPointRedemptionsModifyCall
- func (api *ChannelPointRedemptionsModifyCall) RewardID(rewardID string) *ChannelPointRedemptionsModifyCall
- type ChannelPointRedemptionsModifyResponse
- type ChannelPointRewardsDeleteCall
- func (api *ChannelPointRewardsDeleteCall) BroadcasterID(broadcasterID string) *ChannelPointRewardsDeleteCall
- func (api *ChannelPointRewardsDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRewardsDeleteResponse, error)
- func (api *ChannelPointRewardsDeleteCall) ID(id string) *ChannelPointRewardsDeleteCall
- type ChannelPointRewardsDeleteResponse
- type ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) BackgroundColor(backgroundColor string) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) BroadcasterID(broadcasterID string) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) Cost(cost int64) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRewardsInsertResponse, error)
- func (api *ChannelPointRewardsInsertCall) GlobalCooldownSeconds(globalCooldownSeconds int) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) IsEnabled(isEnabled bool) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) IsGlobalCooldownEnabled(isGlobalCooldownEnabled bool) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) IsMaxPerStreamEnabled(isMaxPerStreamEnabled bool) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) IsMaxPerUserPerStreamEnabled(isMaxPerUserPerStreamEnabled bool) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) IsUserInputRequired(isUserInputRequired bool) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) MaxPerStream(maxPerStream int) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) MaxPerUserPerStream(maxPerUserPerStream int) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) Prompt(prompt string) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) ShouldRedemptionsSkipRequestQueue(shouldRedemptionsSkipRequestQueue bool) *ChannelPointRewardsInsertCall
- func (api *ChannelPointRewardsInsertCall) Title(title string) *ChannelPointRewardsInsertCall
- type ChannelPointRewardsInsertResponse
- type ChannelPointRewardsListCall
- func (api *ChannelPointRewardsListCall) BroadcasterID(broadcasterID string) *ChannelPointRewardsListCall
- func (api *ChannelPointRewardsListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRewardsListResponse, error)
- func (api *ChannelPointRewardsListCall) ID(ids ...string) *ChannelPointRewardsListCall
- func (api *ChannelPointRewardsListCall) OnlyManageableRewards(onlyManageableRewards bool) *ChannelPointRewardsListCall
- type ChannelPointRewardsListResponse
- type ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) BackgroundColor(backgroundColor string) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) BroadcasterID(broadcasterID string) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) Cost(cost int) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRewardsModifyResponse, error)
- func (api *ChannelPointRewardsModifyCall) GlobalCooldownSeconds(globalCooldownSeconds int) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) ID(id string) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) IsEnabled(isEnabled bool) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) IsGlobalCooldownEnabled(isGlobalCooldownEnabled bool) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) IsMaxPerStreamEnabled(isMaxPerStreamEnabled bool) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) IsMaxPerUserPerStreamEnabled(isMaxPerUserPerStreamEnabled bool) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) IsPaused(isPaused bool) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) IsUserInputRequired(isUserInputRequired bool) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) MaxPerStream(maxPerStream int) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) MaxPerUserPerStream(maxPerUserPerStream int) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) Prompt(prompt string) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) ShouldRedemptionsSkipRequestQueue(shouldRedemptionsSkipRequestQueue bool) *ChannelPointRewardsModifyCall
- func (api *ChannelPointRewardsModifyCall) Title(title string) *ChannelPointRewardsModifyCall
- type ChannelPointRewardsModifyResponse
- type ChannelPointsRedemptionsResource
- type ChannelPointsResource
- type ChannelPointsRewardsResource
- func (r *ChannelPointsRewardsResource) Delete(id string, broadcasterID string) *ChannelPointRewardsDeleteCall
- func (r *ChannelPointsRewardsResource) Insert(broadcasterID string, title string, cost int64) *ChannelPointRewardsInsertCall
- func (r *ChannelPointsRewardsResource) List(broadcasterID string) *ChannelPointRewardsListCall
- func (r *ChannelPointsRewardsResource) Modify(id string, broadcasterID string) *ChannelPointRewardsModifyCall
- type ChannelSearchResult
- type ChannelStreamScheduleListCall
- func (api *ChannelStreamScheduleListCall) After(after string) *ChannelStreamScheduleListCall
- func (api *ChannelStreamScheduleListCall) BroadcasterID(broadcasterID string) *ChannelStreamScheduleListCall
- func (api *ChannelStreamScheduleListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelStreamScheduleListResponse, error)
- func (api *ChannelStreamScheduleListCall) First(first int) *ChannelStreamScheduleListCall
- func (api *ChannelStreamScheduleListCall) ID(id string) *ChannelStreamScheduleListCall
- func (api *ChannelStreamScheduleListCall) StartTime(startTime time.Time) *ChannelStreamScheduleListCall
- type ChannelStreamScheduleListResponse
- type ChannelSubscription
- type ChannelTeam
- type ChannelTeamsListCall
- type ChannelTeamsListResponse
- type ChannelsEditorsResource
- type ChannelsFollowedListCall
- func (api *ChannelsFollowedListCall) After(after string) *ChannelsFollowedListCall
- func (api *ChannelsFollowedListCall) BroadcasterID(broadcasterID string) *ChannelsFollowedListCall
- func (api *ChannelsFollowedListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelsFollowedListResponse, error)
- func (api *ChannelsFollowedListCall) First(first int) *ChannelsFollowedListCall
- func (api *ChannelsFollowedListCall) UserID(userID string) *ChannelsFollowedListCall
- type ChannelsFollowedListResponse
- type ChannelsFollowedResource
- type ChannelsFollowersResource
- type ChannelsResource
- type CharityCampaign
- type CharityCampaignAmount
- type CharityCampaignDonation
- type CharityCampaignListCall
- type CharityCampaignListResponse
- type CharityCampaignResource
- type CharityDonationsListCall
- func (api *CharityDonationsListCall) After(after string) *CharityDonationsListCall
- func (api *CharityDonationsListCall) BroadcasterID(broadcasterID string) *CharityDonationsListCall
- func (api *CharityDonationsListCall) Do(ctx context.Context, opts ...RequestOption) (*CharityDonationsListResponse, error)
- func (api *CharityDonationsListCall) First(first int) *CharityDonationsListCall
- type CharityDonationsListResponse
- type CharityDonationsResource
- type CharityResource
- type ChatAnnouncementInsertCall
- func (api *ChatAnnouncementInsertCall) BroadcasterID(broadcasterID string) *ChatAnnouncementInsertCall
- func (api *ChatAnnouncementInsertCall) Color(color string) *ChatAnnouncementInsertCall
- func (api *ChatAnnouncementInsertCall) Do(ctx context.Context, opts ...RequestOption) (*ChatAnnouncementInsertResponse, error)
- func (api *ChatAnnouncementInsertCall) Message(message string) *ChatAnnouncementInsertCall
- func (api *ChatAnnouncementInsertCall) ModeratorID(moderatorID string) *ChatAnnouncementInsertCall
- type ChatAnnouncementInsertResponse
- type ChatAnnouncementResource
- type ChatBadge
- type ChatBadgeVersion
- type ChatBadgesGlobalResource
- type ChatBadgesResource
- type ChatChattersListCall
- func (api *ChatChattersListCall) After(after string) *ChatChattersListCall
- func (api *ChatChattersListCall) BroadcasterID(broadcasterID string) *ChatChattersListCall
- func (api *ChatChattersListCall) Do(ctx context.Context, opts ...RequestOption) (*ChatChattersListResponse, error)
- func (api *ChatChattersListCall) First(first int) *ChatChattersListCall
- func (api *ChatChattersListCall) ModeratorID(moderatorID string) *ChatChattersListCall
- type ChatChattersListResponse
- type ChatChattersResource
- type ChatChattersUserColorResource
- type ChatChattersUserResource
- type ChatEmoteSetsResource
- type ChatEmotesChannelResource
- type ChatEmotesGlobalResource
- type ChatEmotesResource
- type ChatEmotesUserResource
- type ChatMessagesDeleteCall
- func (api *ChatMessagesDeleteCall) BroadcasterID(broadcasterID string) *ChatMessagesDeleteCall
- func (api *ChatMessagesDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*ChatMessagesDeleteResponse, error)
- func (api *ChatMessagesDeleteCall) MessageID(messageID string) *ChatMessagesDeleteCall
- func (api *ChatMessagesDeleteCall) ModeratorID(moderatorID string) *ChatMessagesDeleteCall
- type ChatMessagesDeleteResponse
- type ChatResource
- type ChatSettings
- type ChatSettingsListCall
- type ChatSettingsListResponse
- type ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) BroadcasterID(broadcasterID string) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ChatSettingsModifyResponse, error)
- func (api *ChatSettingsModifyCall) EmoteMode(emoteMode bool) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) FollowerMode(followerMode bool) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) FollowerModeDuration(followerModeDuration int) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) ModeratorID(moderatorID string) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) NonModeratorChatDelay(nonModeratorChatDelay bool) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) NonModeratorChatDelayDuration(nonModeratorChatDelayDuration int) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) SlowMode(slowMode bool) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) SlowModeWaitTime(slowModeWaitTime int) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) SubscriberMode(subscriberMode bool) *ChatSettingsModifyCall
- func (api *ChatSettingsModifyCall) UniqueChatMode(uniqueChatMode bool) *ChatSettingsModifyCall
- type ChatSettingsModifyResponse
- type ChatSettingsResource
- type ChatSharedResource
- type ChatShoutoutInsertCall
- func (api *ChatShoutoutInsertCall) Do(ctx context.Context, opts ...RequestOption) (*ChatShoutoutInsertResponse, error)
- func (api *ChatShoutoutInsertCall) FromBroadcasterID(fromBroadcasterID string) *ChatShoutoutInsertCall
- func (api *ChatShoutoutInsertCall) ModeratorID(moderatorID string) *ChatShoutoutInsertCall
- func (api *ChatShoutoutInsertCall) ToBroadcasterID(toBroadcasterID string) *ChatShoutoutInsertCall
- type ChatShoutoutInsertResponse
- type ChatShoutoutResource
- type Cheermote
- type CheermoteTier
- type Client
- type ClientOption
- type Clip
- type ClipsDownloadListCall
- func (api *ClipsDownloadListCall) BroadcasterID(broadcasterID string) *ClipsDownloadListCall
- func (api *ClipsDownloadListCall) ClipID(clipID string) *ClipsDownloadListCall
- func (api *ClipsDownloadListCall) Do(ctx context.Context, opts ...RequestOption) (*ClipsDownloadListResponse, error)
- func (api *ClipsDownloadListCall) EditorID(editorID string) *ClipsDownloadListCall
- type ClipsDownloadListResponse
- type ClipsDownloadResource
- type ClipsListCall
- func (api *ClipsListCall) After(after string) *ClipsListCall
- func (api *ClipsListCall) Before(before string) *ClipsListCall
- func (api *ClipsListCall) BroadcasterID(broadcasterID string) *ClipsListCall
- func (api *ClipsListCall) Do(ctx context.Context, opts ...RequestOption) (*ClipsListResponse, error)
- func (api *ClipsListCall) EndedAt(endedAt time.Time) *ClipsListCall
- func (api *ClipsListCall) First(first int) *ClipsListCall
- func (api *ClipsListCall) GameID(gameID string) *ClipsListCall
- func (api *ClipsListCall) ID(ids ...string) *ClipsListCall
- func (api *ClipsListCall) IsFeatured(isFeatured bool) *ClipsListCall
- func (api *ClipsListCall) StartedAt(startedAt time.Time) *ClipsListCall
- type ClipsListResponse
- type ClipsResource
- type Commercial
- type Conduit
- type ConduitError
- type ConduitShard
- type ConduitsDeleteCall
- type ConduitsDeleteResponse
- type ConduitsInsertCall
- type ConduitsInsertResponse
- type ConduitsListCall
- type ConduitsListResponse
- type ConduitsModifyCall
- type ConduitsModifyResponse
- type ConduitsResource
- type ConduitsShardListCall
- func (api *ConduitsShardListCall) After(after string) *ConduitsShardListCall
- func (api *ConduitsShardListCall) ConduitID(conduitID string) *ConduitsShardListCall
- func (api *ConduitsShardListCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsShardListResponse, error)
- func (api *ConduitsShardListCall) Status(status string) *ConduitsShardListCall
- type ConduitsShardListResponse
- type ConduitsShardModifyCall
- func (api *ConduitsShardModifyCall) ConduitID(conduitID string) *ConduitsShardModifyCall
- func (api *ConduitsShardModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsShardModifyResponse, error)
- func (api *ConduitsShardModifyCall) Shards(shardss ...ConduitShard) *ConduitsShardModifyCall
- type ConduitsShardModifyResponse
- type ConduitsShardsResource
- type ContentClassificationLabel
- type ContentLabelsListCall
- type ContentLabelsListResponse
- type ContentLabelsResource
- type CreateClipInsertCall
- type CreateClipInsertResponse
- type CreatorGoal
- type CustomReward
- type CustomRewardGlobalCooldownSetting
- type CustomRewardMaxPerStreamSetting
- type CustomRewardMaxPerUserPerStreamSetting
- type CustomRewardRedemption
- type DateRange
- type DownloadableClip
- type DropEntitlement
- type DropsEntitlementsListCall
- func (api *DropsEntitlementsListCall) After(after string) *DropsEntitlementsListCall
- func (api *DropsEntitlementsListCall) Do(ctx context.Context, opts ...RequestOption) (*DropsEntitlementsListResponse, error)
- func (api *DropsEntitlementsListCall) First(first int) *DropsEntitlementsListCall
- func (api *DropsEntitlementsListCall) FulfillmentStatus(fulfillmentStatus string) *DropsEntitlementsListCall
- func (api *DropsEntitlementsListCall) GameID(gameID string) *DropsEntitlementsListCall
- func (api *DropsEntitlementsListCall) ID(ids ...string) *DropsEntitlementsListCall
- func (api *DropsEntitlementsListCall) UserID(userID string) *DropsEntitlementsListCall
- type DropsEntitlementsListResponse
- type DropsEntitlementsModifyCall
- func (api *DropsEntitlementsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*DropsEntitlementsModifyResponse, error)
- func (api *DropsEntitlementsModifyCall) EntitlementID(entitlementIDs ...string) *DropsEntitlementsModifyCall
- func (api *DropsEntitlementsModifyCall) FulfillmentStatus(fulfillmentStatus string) *DropsEntitlementsModifyCall
- type DropsEntitlementsModifyResponse
- type EditableClip
- type Emote
- type EmoteSetsListCall
- type EmoteSetsListResponse
- type EntitlementsDropsResource
- type EntitlementsResource
- type EventSubResource
- type EventSubSubscription
- type EventSubSubscriptionsListCall
- func (api *EventSubSubscriptionsListCall) After(after string) *EventSubSubscriptionsListCall
- func (api *EventSubSubscriptionsListCall) Do(ctx context.Context, opts ...RequestOption) (*EventSubSubscriptionsListResponse, error)
- func (api *EventSubSubscriptionsListCall) Status(status string) *EventSubSubscriptionsListCall
- func (api *EventSubSubscriptionsListCall) SubscriptionID(subscriptionID string) *EventSubSubscriptionsListCall
- func (api *EventSubSubscriptionsListCall) Type(t string) *EventSubSubscriptionsListCall
- func (api *EventSubSubscriptionsListCall) UserID(userID string) *EventSubSubscriptionsListCall
- type EventSubSubscriptionsListResponse
- type EventSubTransport
- type Extension
- type ExtensionAnalyticsListCall
- func (api *ExtensionAnalyticsListCall) After(after string) *ExtensionAnalyticsListCall
- func (api *ExtensionAnalyticsListCall) Do(ctx context.Context, opts ...RequestOption) (*ExtensionAnalyticsListResponse, error)
- func (api *ExtensionAnalyticsListCall) EndedAt(endedAt time.Time) *ExtensionAnalyticsListCall
- func (api *ExtensionAnalyticsListCall) ExtensionID(extensionID string) *ExtensionAnalyticsListCall
- func (api *ExtensionAnalyticsListCall) First(first int) *ExtensionAnalyticsListCall
- func (api *ExtensionAnalyticsListCall) StartedAt(startedAt time.Time) *ExtensionAnalyticsListCall
- func (api *ExtensionAnalyticsListCall) Type(t string) *ExtensionAnalyticsListCall
- type ExtensionAnalyticsListResponse
- type ExtensionAnalyticsReport
- type ExtensionBitsProduct
- type ExtensionBitsProductCost
- type ExtensionComponentView
- type ExtensionConfigurationSegment
- type ExtensionLiveChannel
- type ExtensionMobileView
- type ExtensionPanelView
- type ExtensionProduct
- type ExtensionProductCost
- type ExtensionSecret
- type ExtensionSecretItem
- type ExtensionTransaction
- type ExtensionVideoOverlayView
- type ExtensionViews
- type ExtensionsListCall
- type ExtensionsListResponse
- type ExtensionsResource
- type Followed
- type Follower
- type Game
- type GameAnalyticsListCall
- func (api *GameAnalyticsListCall) After(after string) *GameAnalyticsListCall
- func (api *GameAnalyticsListCall) Do(ctx context.Context, opts ...RequestOption) (*GameAnalyticsListResponse, error)
- func (api *GameAnalyticsListCall) EndedAt(endedAt time.Time) *GameAnalyticsListCall
- func (api *GameAnalyticsListCall) First(first int) *GameAnalyticsListCall
- func (api *GameAnalyticsListCall) GameID(gameID string) *GameAnalyticsListCall
- func (api *GameAnalyticsListCall) StartedAt(startedAt time.Time) *GameAnalyticsListCall
- func (api *GameAnalyticsListCall) Type(t string) *GameAnalyticsListCall
- type GameAnalyticsListResponse
- type GameAnalyticsReport
- type GamesListCall
- type GamesListResponse
- type GamesResource
- type GamesTopResource
- type GlobalChatBadgesListCall
- type GlobalChatBadgesListResponse
- type GlobalEmotesListCall
- type GlobalEmotesListResponse
- type GoalsListCall
- type GoalsListResponse
- type GoalsResource
- type GuestStarGuest
- type GuestStarInvite
- type GuestStarResource
- type GuestStarSession
- type GuestStarSessionListCall
- func (api *GuestStarSessionListCall) BroadcasterID(broadcasterID string) *GuestStarSessionListCall
- func (api *GuestStarSessionListCall) Do(ctx context.Context, opts ...RequestOption) (*GuestStarSessionListResponse, error)
- func (api *GuestStarSessionListCall) ModeratorID(moderatorID string) *GuestStarSessionListCall
- type GuestStarSessionListResponse
- type GuestStarSessionResource
- type HTTPClient
- type HypeTrainContribution
- type HypeTrainEvent
- type HypeTrainEventContribution
- type HypeTrainEventData
- type HypeTrainParticipant
- type HypeTrainRecord
- type HypeTrainResource
- type HypeTrainStatus
- type HypeTrainStatusInfo
- type HypeTrainStatusListCall
- type HypeTrainStatusListResponse
- type InitializedRaid
- type IssuedBan
- type MediaSettings
- type ModeratedChannel
- type ModerationBansResource
- type ModerationClearChatResource
- type ModerationResource
- type OutboundBan
- type OutboundChatMessage
- type OutboundChatMessageDropReason
- type OutboundChoice
- type OutboundPredictionOutcome
- type Pagination
- type Poll
- type PollChoice
- type PollsInsertCall
- func (api *PollsInsertCall) BroadcasterID(broadcasterID string) *PollsInsertCall
- func (api *PollsInsertCall) ChannelPointsPerVote(channelPointsPerVote int) *PollsInsertCall
- func (api *PollsInsertCall) ChannelPointsVotingEnabled(channelPointsVotingEnabled bool) *PollsInsertCall
- func (api *PollsInsertCall) Choices(choicess ...OutboundChoice) *PollsInsertCall
- func (api *PollsInsertCall) Do(ctx context.Context, opts ...RequestOption) (*PollsInsertResponse, error)
- func (api *PollsInsertCall) Duration(duration int) *PollsInsertCall
- func (api *PollsInsertCall) Title(title string) *PollsInsertCall
- type PollsInsertResponse
- type PollsListCall
- func (api *PollsListCall) After(after string) *PollsListCall
- func (api *PollsListCall) BroadcasterID(broadcasterID string) *PollsListCall
- func (api *PollsListCall) Do(ctx context.Context, opts ...RequestOption) (*PollsListResponse, error)
- func (api *PollsListCall) First(first int) *PollsListCall
- func (api *PollsListCall) ID(ids ...string) *PollsListCall
- type PollsListResponse
- type PollsModifyCall
- func (api *PollsModifyCall) BroadcasterID(broadcasterID string) *PollsModifyCall
- func (api *PollsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*PollsModifyResponse, error)
- func (api *PollsModifyCall) ID(id string) *PollsModifyCall
- func (api *PollsModifyCall) Status(status string) *PollsModifyCall
- type PollsModifyResponse
- type PollsResource
- type Prediction
- type PredictionOutcome
- type PredictionParticipant
- type PredictionsInsertCall
- func (api *PredictionsInsertCall) BroadcasterID(broadcasterID string) *PredictionsInsertCall
- func (api *PredictionsInsertCall) Do(ctx context.Context, opts ...RequestOption) (*PredictionsInsertResponse, error)
- func (api *PredictionsInsertCall) Outcome(outcomes ...OutboundChoice) *PredictionsInsertCall
- func (api *PredictionsInsertCall) PredictionWindow(predictionWindow int) *PredictionsInsertCall
- func (api *PredictionsInsertCall) Title(title string) *PredictionsInsertCall
- type PredictionsInsertResponse
- type PredictionsListCall
- func (api *PredictionsListCall) After(after string) *PredictionsListCall
- func (api *PredictionsListCall) BroadcasterID(broadcasterID string) *PredictionsListCall
- func (api *PredictionsListCall) Do(ctx context.Context, opts ...RequestOption) (*PredictionsListResponse, error)
- func (api *PredictionsListCall) First(first int) *PredictionsListCall
- func (api *PredictionsListCall) ID(ids ...string) *PredictionsListCall
- type PredictionsListResponse
- type PredictionsModifyCall
- func (api *PredictionsModifyCall) BroadcasterID(broadcasterID string) *PredictionsModifyCall
- func (api *PredictionsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*PredictionsModifyResponse, error)
- func (api *PredictionsModifyCall) ID(id string) *PredictionsModifyCall
- func (api *PredictionsModifyCall) Status(status string) *PredictionsModifyCall
- func (api *PredictionsModifyCall) WinningOutcomeID(winningOutcomeID string) *PredictionsModifyCall
- type PredictionsModifyResponse
- type PredictionsResource
- func (r *PredictionsResource) Insert(broadcasterID string, title string, predictionWindow int) *PredictionsInsertCall
- func (r *PredictionsResource) List(broadcasterID string) *PredictionsListCall
- func (r *PredictionsResource) Modify(broadcasterID string, id string, status string) *PredictionsModifyCall
- type RaidDeleteCall
- type RaidDeleteResponse
- type RaidInsertCall
- type RaidInsertResponse
- type RaidsResource
- type RedemptionRewardInfo
- type RequestOption
- func AddHeader[T any](key string, value T) RequestOption
- func AddQueryParameter[T any](key string, value T) RequestOption
- func SetHeader[T any](key string, value T) RequestOption
- func SetQueryParameter[T any](key string, value T) RequestOption
- func WithAuthorization(authorization Authorization) RequestOption
- func WithBearerToken(token string) RequestOption
- type ResponseData
- type ScheduleResource
- type SearchCategoriesListCall
- func (api *SearchCategoriesListCall) After(after string) *SearchCategoriesListCall
- func (api *SearchCategoriesListCall) Do(ctx context.Context, opts ...RequestOption) (*SearchCategoriesListResponse, error)
- func (api *SearchCategoriesListCall) First(first int) *SearchCategoriesListCall
- func (api *SearchCategoriesListCall) Query(query string) *SearchCategoriesListCall
- type SearchCategoriesListResponse
- type SearchCategoriesResource
- type SearchChannelsListCall
- func (api *SearchChannelsListCall) After(after string) *SearchChannelsListCall
- func (api *SearchChannelsListCall) Do(ctx context.Context, opts ...RequestOption) (*SearchChannelsListResponse, error)
- func (api *SearchChannelsListCall) First(first int) *SearchChannelsListCall
- func (api *SearchChannelsListCall) LiveOnly(liveOnly bool) *SearchChannelsListCall
- func (api *SearchChannelsListCall) Query(query string) *SearchChannelsListCall
- type SearchChannelsListResponse
- type SearchChannelsResource
- type SearchResource
- type SendMessageInsertCall
- func (api *SendMessageInsertCall) BroadcasterID(broadcasterID string) *SendMessageInsertCall
- func (api *SendMessageInsertCall) Do(ctx context.Context, opts ...RequestOption) (*SendMessageInsertResponse, error)
- func (api *SendMessageInsertCall) ForSourceOnly(forSourceOnly bool) *SendMessageInsertCall
- func (api *SendMessageInsertCall) Message(message string) *SendMessageInsertCall
- func (api *SendMessageInsertCall) ReplayParentMessageID(replayParentMessageID string) *SendMessageInsertCall
- func (api *SendMessageInsertCall) SenderID(senderID string) *SendMessageInsertCall
- type SendMessageInsertResponse
- type SendWhisperInsertCall
- func (api *SendWhisperInsertCall) Do(ctx context.Context, opts ...RequestOption) (*SendWhisperInsertResponse, error)
- func (api *SendWhisperInsertCall) FromUserID(fromUserID string) *SendWhisperInsertCall
- func (api *SendWhisperInsertCall) Message(message string) *SendWhisperInsertCall
- func (api *SendWhisperInsertCall) ToUserID(toUserID string) *SendWhisperInsertCall
- type SendWhisperInsertResponse
- type SharedChatSession
- type SharedChatSessionListCall
- type SharedChatSessionListResponse
- type SharedChatSessionParticipant
- type ShieldModeStatus
- type SizedImage
- type SnoozeNextAdInsertCall
- type SnoozeNextAdInsertResponse
- type StartCommercialInsertCall
- func (api *StartCommercialInsertCall) BroadcasterID(broadcasterID string) *StartCommercialInsertCall
- func (api *StartCommercialInsertCall) Do(ctx context.Context, opts ...RequestOption) (*StartCommercialInsertResponse, error)
- func (api *StartCommercialInsertCall) Length(length int) *StartCommercialInsertCall
- type StartCommercialInsertResponse
- type Stream
- type StreamKey
- type StreamKeyListCall
- type StreamKeyListResponse
- type StreamMarker
- type StreamMarkerData
- type StreamMarkerInsertCall
- func (api *StreamMarkerInsertCall) BroadcasterID(broadcasterID string) *StreamMarkerInsertCall
- func (api *StreamMarkerInsertCall) Description(description string) *StreamMarkerInsertCall
- func (api *StreamMarkerInsertCall) Do(ctx context.Context, opts ...RequestOption) (*StreamMarkerInsertResponse, error)
- type StreamMarkerInsertResponse
- type StreamMarkerListCall
- func (api *StreamMarkerListCall) After(after string) *StreamMarkerListCall
- func (api *StreamMarkerListCall) Before(before string) *StreamMarkerListCall
- func (api *StreamMarkerListCall) BroadcasterID(broadcasterID string) *StreamMarkerListCall
- func (api *StreamMarkerListCall) Do(ctx context.Context, opts ...RequestOption) (*StreamMarkerListResponse, error)
- func (api *StreamMarkerListCall) First(first int) *StreamMarkerListCall
- func (api *StreamMarkerListCall) VideoID(videoID string) *StreamMarkerListCall
- type StreamMarkerListResponse
- type StreamMarkerVideo
- type StreamSchedule
- type StreamScheduleCategory
- type StreamScheduleSegment
- type StreamScheduleVacation
- type StreamTag
- type StreamsFollowedListCall
- func (api *StreamsFollowedListCall) After(after string) *StreamsFollowedListCall
- func (api *StreamsFollowedListCall) Do(ctx context.Context, opts ...RequestOption) (*StreamsFollowedListResponse, error)
- func (api *StreamsFollowedListCall) First(first int) *StreamsFollowedListCall
- func (api *StreamsFollowedListCall) UserID(userID string) *StreamsFollowedListCall
- type StreamsFollowedListResponse
- type StreamsFollowedResource
- type StreamsListCall
- func (api *StreamsListCall) After(after string) *StreamsListCall
- func (api *StreamsListCall) Before(before string) *StreamsListCall
- func (api *StreamsListCall) Do(ctx context.Context, opts ...RequestOption) (*StreamsListResponse, error)
- func (api *StreamsListCall) First(first int) *StreamsListCall
- func (api *StreamsListCall) GameID(gameIDs ...string) *StreamsListCall
- func (api *StreamsListCall) ID(ids ...string) *StreamsListCall
- func (api *StreamsListCall) Language(language string) *StreamsListCall
- func (api *StreamsListCall) Period(period string) *StreamsListCall
- func (api *StreamsListCall) Type(t string) *StreamsListCall
- func (api *StreamsListCall) UserID(userIDs ...string) *StreamsListCall
- type StreamsListResponse
- type StreamsMarkersResource
- type StreamsResource
- type StreamsStreamKeyResource
- type SubscriptionsResource
- type SubscriptionsSubscribedResource
- type Team
- type TeamsChannelsResource
- type TeamsListCall
- type TeamsListResponse
- type TeamsResource
- type TopGamesListCall
- func (api *TopGamesListCall) After(after string) *TopGamesListCall
- func (api *TopGamesListCall) Before(before string) *TopGamesListCall
- func (api *TopGamesListCall) Do(ctx context.Context, opts ...RequestOption) (*TopGamesListResponse, error)
- func (api *TopGamesListCall) First(first int) *TopGamesListCall
- type TopGamesListResponse
- type Transport
- type TwitchAPIError
- type UnbanRequest
- type UnbanUserDeleteCall
- func (api *UnbanUserDeleteCall) BroadcasterID(broadcasterID string) *UnbanUserDeleteCall
- func (api *UnbanUserDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*UnbanUserDeleteResponse, error)
- func (api *UnbanUserDeleteCall) ModeratorID(moderatorID string) *UnbanUserDeleteCall
- func (api *UnbanUserDeleteCall) UserID(userID string) *UnbanUserDeleteCall
- type UnbanUserDeleteResponse
- type UpdatedDropEntitlement
- type User
- type UserActiveExtension
- type UserActiveExtensionData
- type UserActiveExtensionPositionalData
- type UserAuthorization
- type UserChatColor
- type UserChatColorListCall
- type UserChatColorListResponse
- type UserChatColorUpdateCall
- type UserChatColorUpdateResponse
- type UserEmotesListCall
- func (api *UserEmotesListCall) After(after string) *UserEmotesListCall
- func (api *UserEmotesListCall) BroadcasterID(broadcasterID string) *UserEmotesListCall
- func (api *UserEmotesListCall) Do(ctx context.Context, opts ...RequestOption) (*UserEmotesListResponse, error)
- func (api *UserEmotesListCall) UserID(userID string) *UserEmotesListCall
- type UserEmotesListResponse
- type UserExtension
- type UserInfo
- type UserSubscriptionListCall
- func (api *UserSubscriptionListCall) BroadcasterID(broadcasterID string) *UserSubscriptionListCall
- func (api *UserSubscriptionListCall) Do(ctx context.Context, opts ...RequestOption) (*UserSubscriptionListResponse, error)
- func (api *UserSubscriptionListCall) UserID(userID string) *UserSubscriptionListCall
- type UserSubscriptionListResponse
- type UserSubscriptionStatus
- type UserWarning
- type UsersAuthorizationResource
- type UsersListCall
- type UsersListResponse
- type UsersResource
- type Video
- type VideoDuration
- type VideoMutedSegment
- type VideosDeleteCall
- type VideosDeleteResponse
- type VideosListCall
- func (api *VideosListCall) After(after string) *VideosListCall
- func (api *VideosListCall) Do(ctx context.Context, opts ...RequestOption) (*VideosListResponse, error)
- func (api *VideosListCall) First(first int) *VideosListCall
- func (api *VideosListCall) GameID(gameIDs ...string) *VideosListCall
- func (api *VideosListCall) ID(ids ...string) *VideosListCall
- func (api *VideosListCall) Language(language string) *VideosListCall
- func (api *VideosListCall) Period(period string) *VideosListCall
- func (api *VideosListCall) Sort(sort string) *VideosListCall
- func (api *VideosListCall) Type(t string) *VideosListCall
- func (api *VideosListCall) UserID(userIDs ...string) *VideosListCall
- type VideosListResponse
- type VideosResource
- type WhispersResource
Constants ¶
const ( // BaseURL is the base URL for the Twitch API. BaseURL string = "https://api.twitch.tv" // TwitchAPIVersionHelix is the base path for the Helix API. TwitchAPIVersionHelix string = "/helix" )
const ( // EndpointAdsStartCommercial is the endpoint for starting a commercial. EndpointAdsStartCommercial = TwitchAPIVersionHelix + "/channels/commercial" // EndpointAdsGetAdsSchedule is the endpoint for getting ad schedule information. EndpointAdsGetAdsSchedule = TwitchAPIVersionHelix + "/channels/ads" // EndpointAdsSnoozeNextAd is the endpoint for snoozing the next ad. EndpointAdsSnoozeNextAd = TwitchAPIVersionHelix + "/channels/ads/schedule/snooze" // EndpointAnalyticsGetExtensionAnalytics is the endpoint for getting extension analytics. EndpointAnalyticsGetExtensionAnalytics = TwitchAPIVersionHelix + "/analytics/extensions" // EndpointAnalyticsGetGameAnalytics is the endpoint for getting game analytics. EndpointAnalyticsGetGameAnalytics = TwitchAPIVersionHelix + "/analytics/games" // EndpointBitsGetLeaderboard is the endpoint for getting the Bits leaderboard. EndpointBitsGetLeaderboard = TwitchAPIVersionHelix + "/bits/leaderboard" // EndpointBitsGetCheermotes is the endpoint for getting cheermotes. EndpointBitsGetCheermotes = TwitchAPIVersionHelix + "/bits/cheermotes" // EndpointBitsGetExtensionTransactions is the endpoint for getting extension transactions. EndpointBitsGetExtensionTransactions = TwitchAPIVersionHelix + "/extensions/transactions" // EndpointChannelPointsCreateCustomRewards is the endpoint for creating custom rewards. EndpointChannelPointsCreateCustomRewards = TwitchAPIVersionHelix + "/channel_points/custom_rewards" // EndpointChannelPointsDeleteCustomReward is the endpoint for deleting a custom reward. EndpointChannelPointsDeleteCustomReward = TwitchAPIVersionHelix + "/channel_points/custom_rewards" // EndpointChannelPointsGetCustomRewards is the endpoint for getting custom rewards. EndpointChannelPointsGetCustomRewards = TwitchAPIVersionHelix + "/channel_points/custom_rewards" // EndpointChannelPointsGetCustomRewardRedemptions is the endpoint for getting custom reward redemptions. EndpointChannelPointsGetCustomRewardRedemptions = TwitchAPIVersionHelix + "/channel_points/custom_rewards/redemptions" // EndpointChannelPointsUpdateCustomReward is the endpoint for updating a custom reward. EndpointChannelPointsUpdateCustomReward = TwitchAPIVersionHelix + "/channel_points/custom_rewards" // EndpointChannelPointsUpdateRedemptionStatus is the endpoint for updating the status of a reward redemption. EndpointChannelPointsUpdateRedemptionStatus = TwitchAPIVersionHelix + "/channel_points/custom_rewards/redemptions" // EndpointChannelsGetInformation is the endpoint for getting channel information. EndpointChannelsGetInformation = TwitchAPIVersionHelix + "/channels" // EndpointChannelsModifyInformation is the endpoint for modifying channel information. EndpointChannelsModifyInformation = TwitchAPIVersionHelix + "/channels" // EndpointChannelsGetEditors is the endpoint for getting channel editors. EndpointChannelsGetEditors = TwitchAPIVersionHelix + "/channels/editors" // EndpointChannelsGetFollowedChannels is the endpoint for getting followed channels. EndpointChannelsGetFollowedChannels = TwitchAPIVersionHelix + "/channels/followed" // EndpointChannelsGetFollowers is the endpoint for getting channel followers. EndpointChannelsGetFollowers = TwitchAPIVersionHelix + "/channels/followers" // EndpointCharityGetCampaign is the endpoint for getting charity campaigns. EndpointCharityGetCampaign = TwitchAPIVersionHelix + "/charity/campaigns" // EndpointCharityGetCampaignDonations is the endpoint for getting charity campaign donations. EndpointCharityGetCampaignDonations = TwitchAPIVersionHelix + "/charity/donations" // EndpointChatGetChatters is the endpoint for getting chatters in a channel. EndpointChatGetChatters = TwitchAPIVersionHelix + "/chat/chatters" // EndpointChatGetChannelEmotes is the endpoint for getting channel emotes. EndpointChatGetChannelEmotes = TwitchAPIVersionHelix + "/chat/emotes" // EndpointChatGetGlobalEmotes is the endpoint for getting global emotes. EndpointChatGetGlobalEmotes = TwitchAPIVersionHelix + "/chat/emotes/global" // EndpointChatGetEmoteSets is the endpoint for getting emote sets. EndpointChatGetEmoteSets = TwitchAPIVersionHelix + "/chat/emotes/set" // EndpointChatGetChannelBadges is the endpoint for getting a channels chat badges. EndpointChatGetChannelBadges = TwitchAPIVersionHelix + "/chat/badges" // EndpointChatGetGlobalBadges is the endpoint for getting global chat badges. EndpointChatGetGlobalBadges = TwitchAPIVersionHelix + "/chat/badges/global" // EndpointChatGetSettings is the endpoint for getting chat settings. EndpointChatGetSettings = TwitchAPIVersionHelix + "/chat/settings" EndpointChatGetSharedChatSession = TwitchAPIVersionHelix + "/shared_chat/session" // EndpointChatGetUserEmotes is the endpoint for getting user emotes. EndpointChatGetUserEmotes = TwitchAPIVersionHelix + "/chat/emotes/user" // EndpointChatUpdateSettings is the endpoint for updating a chatrooms settings. EndpointChatUpdateSettings = TwitchAPIVersionHelix + "/chat/settings" // EndpointChatSendAnnouncement is the endpoint for sending an announcement to a chatroom. EndpointChatSendAnnouncement = TwitchAPIVersionHelix + "/chat/announcements" // EndpointChatSendShoutout is the endpoint for sending a shoutout in chat. EndpointChatSendShoutout = TwitchAPIVersionHelix + "/chat/shoutouts" // EndpointChatSendMessage is the endpoint for sending a message in chat. EndpointChatSendMessage = TwitchAPIVersionHelix + "/chat/messages" // EndpointChatGetUserColor is the endpoint for getting a user's chat color. EndpointChatGetUserColor = TwitchAPIVersionHelix + "/chat/color" // EndpointChatUpdateUserColor is the endpoint for updating a user's chat color. EndpointChatUpdateUserColor = TwitchAPIVersionHelix + "/chat/color" // EndpointClips is the endpoint for the Twitch Clips API. EndpointClips = TwitchAPIVersionHelix + "/clips" // EndpointClipsGetClipsDownload is the endpoint for getting clip download URLs. EndpointClipsGetClipsDownload = TwitchAPIVersionHelix + "/clips/downloads" // EndpointConduitsShards is the endpoint for the Twitch Eventsub Conduit Shards API. EndpointConduitsShards = TwitchAPIVersionHelix + "/eventsub/conduits/shards" // EndpointConduits is the endpoint for the Twitch Eventsub Conduits API. EndpointConduits = TwitchAPIVersionHelix + "/eventsub/conduits" // EndpointContentLabels is the endpoint for getting information about content classification labels. EndpointContentLabels = TwitchAPIVersionHelix + "/content_classification_labels" // EndpointEntitlementsDrops is the endpoint for the Twitch Entitlements Drops API. EndpointEntitlementsDrops = TwitchAPIVersionHelix + "/entitlements/drops" // EndpointEventSubSubscriptions is the endpoint for managing EventSub subscriptions. EndpointEventSubSubscriptions = TwitchAPIVersionHelix + "/eventsub/subscriptions" // EndpointExtensionsConfiguration is the endpoint for managing extension configurations. EndpointExtensionsConfiguration = TwitchAPIVersionHelix + "/extensions/configurations" // EndpointExtensionsRequiredConfiguration is the endpoint for managing required extension configurations. EndpointExtensionsRequiredConfiguration = TwitchAPIVersionHelix + "/extensions/required_configuration" // EndpointExtensionsPubSub is the endpoint for sending extension messages via PubSub. EndpointExtensionsPubSub = TwitchAPIVersionHelix + "/extensions/pubsub" // EndpointExtensionsLiveChannels is the endpoint for fetching live channels by extension. EndpointExtensionsLiveChannels = TwitchAPIVersionHelix + "/extensions/live" // EndpointExtensionsSecrets is the endpoint for managing extension secrets. EndpointExtensionsSecrets = TwitchAPIVersionHelix + "/extensions/jwt/secrets" // EndpointExtensionsChat is the endpoint for sending chat messages via extensions. EndpointExtensionsChat = TwitchAPIVersionHelix + "/extensions/chat" // EndpointExtensions is the endpoint for getting information about an extension. EndpointExtensions = TwitchAPIVersionHelix + "/extensions" // EndpointExtensionsReleased is the endpoint for getting information about released extensions. EndpointExtensionsReleased = TwitchAPIVersionHelix + "/extensions/released" // EndpointExtensionsBitsProducts is the endpoint for managing an extensions Bits product. EndpointExtensionsBitsProducts = TwitchAPIVersionHelix + "/bits/extensions" // EndpointGames is the endpoint for the Twitch Games API. EndpointGames = TwitchAPIVersionHelix + "/games" // EndpointGamesTop is the endpoint for the Twitch Top Games API. EndpointGamesTop = TwitchAPIVersionHelix + "/games/top" // EndpointGoals is the endpoint for managing creator goals. EndpointGoals = TwitchAPIVersionHelix + "/goals" // EndpointGuestStarChannelSettings is the endpoint for managing guest star channel settings. EndpointGuestStarChannelSettings = TwitchAPIVersionHelix + "/guest_star/channel_settings" // EndpointGuestStarSession is the endpoint for managing a guest star session. EndpointGuestStarSession = TwitchAPIVersionHelix + "/guest_star/session" // EndpointGuestStarInvites is the endpoint for managing guest star invites. EndpointGuestStarInvites = TwitchAPIVersionHelix + "/guest_star/invites" // EndpointGuestStarSlot is the endpoint for managing a user that was invited to the guest star session. EndpointGuestStarSlot = TwitchAPIVersionHelix + "/guest_star/slot" // EndpointGuestStarSlotSettings is the endpoint for managing an invited users settings in a guest star session. EndpointGuestStarSlotSettings = TwitchAPIVersionHelix + "/guest_star/slot_settings" // EndpointHypeTrainGetEvents is the endpoint for getting Hype Train events. // // Deprecated: Scheduled for removal on December 4, 2025. Use "Get Hype Train Status" instead. EndpointHypeTrainGetEvents = TwitchAPIVersionHelix + "/hypetrain/events" // EndpointHypeTrainGetStatus is the endpoint for getting the status of a Hype Train. EndpointHypeTrainGetStatus = TwitchAPIVersionHelix + "/hypetrain/status" // EndpointModerationCheckAutoModStatus is the endpoint for checking if a message would be held by AutoMod. EndpointModerationCheckAutoModStatus = TwitchAPIVersionHelix + "/moderation/enforcements/status" // EndpointModerationManageHeldAutoModMessages is the endpoint for managing a message held by AutoMod. EndpointModerationManageHeldAutoModMessages = TwitchAPIVersionHelix + "/moderation/automod/message" // EndpointModerationAutoModSettings is the endpoint for getting and maanaging AutoMod settings for a channel. EndpointModerationAutoModSettings = TwitchAPIVersionHelix + "/moderation/automod/settings" // EndpointModerationGetBannedUsers is the endpoint for getting banned users in a channel. EndpointModerationGetBannedUsers = TwitchAPIVersionHelix + "/moderation/banned" // EndpointModerationBans is the endpoint for managing banned users in a channel. EndpointModerationBans = TwitchAPIVersionHelix + "/moderation/bans" // EndpointModerationUnbanRequests is the endpoint for managing unban requests for a channel. EndpointModerationUnbanRequests = TwitchAPIVersionHelix + "/moderation/unban_requests" // EndpointModerationBlockedTerms is the endpoint for managing a channels blocked terms. EndpointModerationBlockedTerms = TwitchAPIVersionHelix + "/moderation/blocked_terms" // EndpointModerationDeleteChatMessages is the endpoint for deleting chat messages in a channel. EndpointModerationDeleteChatMessages = TwitchAPIVersionHelix + "/moderation/chat" // EndpointModerationModeratedChannels is the endpoint for checking which channels the authenticated user moderates. EndpointModerationModeratedChannels = TwitchAPIVersionHelix + "/moderation/channels" // EndpointModerationModerators is the endpoint for managing moderators in a channel. EndpointModerationModerators = TwitchAPIVersionHelix + "/moderation/moderators" // EndpointModerationVIPs is the endpoint for managing VIPs in a channel. EndpointModerationVIPs = TwitchAPIVersionHelix + "/channels/vips" // EndpointModerationShieldMode is the endpoint for managing a channels Shield Mode settings. EndpointModerationShieldMode = TwitchAPIVersionHelix + "/moderation/shield_mode" // EndpointModerationWarnChatUser is the endpoint for warning a user in chat. EndpointModerationWarnChatUser = TwitchAPIVersionHelix + "/moderation/warnings" // EndpointPolls is the endpoint for the Twitch Polls API. EndpointPolls = TwitchAPIVersionHelix + "/polls" // EndpointPredictions is the endpoint for managing channel predictions. EndpointPredictions = TwitchAPIVersionHelix + "/predictions" // EndpointRaids is the endpoint for managing raids. EndpointRaids = TwitchAPIVersionHelix + "/raids" // EndpointScheduleGetChannelStreamSchedule is the endpoint for getting the stream schedule for a channel. EndpointScheduleGetChannelStreamSchedule = TwitchAPIVersionHelix + "/schedule" // EndpointScheduleGetChannelCalendar is the endpoint for getting the iCalendar schedule for a channel. EndpointScheduleGetChannelCalendar = TwitchAPIVersionHelix + "/schedule/icalendar" // EndpointScheduleChannelSettings is the endpoint for getting or updating channel schedule settings. EndpointScheduleChannelSettings = TwitchAPIVersionHelix + "/schedule/settings" // EndpointScheduleCreateChannelSegment is the endpoint for managing stream schedule segments for a channel. EndpointScheduleCreateChannelSegment = TwitchAPIVersionHelix + "/schedule/segment" // EndpointSearchCategories is the endpoint for searching categories. EndpointSearchCategories = TwitchAPIVersionHelix + "/search/categories" // EndpointSearchChannels is the endpoint for searching channels. EndpointSearchChannels = TwitchAPIVersionHelix + "/search/channels" // EndpointStreamsGetKey is the endpoint for getting a stream key. EndpointStreamsGetKey = TwitchAPIVersionHelix + "/streams/key" // EndpointStreams is the endpoint for getting stream information. EndpointStreams = TwitchAPIVersionHelix + "/streams" // EndpointStreamsFollowed is the endpoint for getting followed streams. EndpointStreamsFollowed = TwitchAPIVersionHelix + "/streams/followed" // EndpointStreamsMarkers is the endpoint for managing a markers for a stream. EndpointStreamsMarkers = TwitchAPIVersionHelix + "/streams/markers" // EndpointSubscriptionsGetBroadcasterSubscriptions is the endpoint for getting broadcaster's subscriptions. EndpointSubscriptionsGetBroadcasterSubscriptions = TwitchAPIVersionHelix + "/subscriptions" // EndpointSubscriptionsCheckUserSubscription is the endpoint for getting a user's subscription. EndpointSubscriptionsCheckUserSubscription = TwitchAPIVersionHelix + "/subscriptions/user" // EndpointTagsGetAllStreamTags is the endpoint for getting all stream tags. EndpointTagsGetAllStreamTags = TwitchAPIVersionHelix + "/tags/streams" // EndpointTagsGetStreamTags is the endpoint for getting tags for a stream. EndpointTagsGetStreamTags = TwitchAPIVersionHelix + "/streams/tags" // EndpointTeams is the endpoint for getting teams. EndpointTeams = TwitchAPIVersionHelix + "/teams" // EndpointTeamsGetChannelTeams is the endpoint for getting a team by name. EndpointTeamsGetChannelTeams = TwitchAPIVersionHelix + "/teams/channel" // EndpointUsers is the endpoint for getting users. EndpointUsers = TwitchAPIVersionHelix + "/users" // EndpointUsersGetAuthorizationByUser is the endpoint for getting authorizations by user. EndpointUsersGetAuthorizationByUser = TwitchAPIVersionHelix + "/authorization/users" // EndpointUsersBlocks is the endpoint for managing blocked users. EndpointUsersBlocks = TwitchAPIVersionHelix + "/users/blocks" // EndpointUsersAllExtensions is the endpoint for getting all extensions a user has installed. EndpointUsersAllExtensions = TwitchAPIVersionHelix + "/users/extensions/list" // EndpointUsersActiveExtensions is the endpoint for getting active extensions for a user. EndpointUsersActiveExtensions = TwitchAPIVersionHelix + "/users/extensions" // EndpointVideos is the endpoint for the Twitch Videos API. EndpointVideos = TwitchAPIVersionHelix + "/videos" // EndpointWhispers is the endpoint for sending whispers. EndpointWhispers = TwitchAPIVersionHelix + "/whispers" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdSchedule ¶
type AdSchedule struct {
// DurationSeconds is the number of seconds the upcoming commercial will run.
DurationSeconds int `json:"duration"`
// PrerollFreeTime is the number of seconds of pre-roll free time remaining for the channel in seconds.
PrerollFreeTime int `json:"preroll_free_time"`
// SnoozeCount is the number of snoozes the broadcaster has available.
SnoozeCount int `json:"snooze_count"`
// SnoozeRefreshAt is the UTC timestamp for when the broadcaster will receive another snooze.
SnoozeRefreshAt time.Time `json:"snooze_refresh_at"`
// NextAdAt is the UTC timestamp for when the next commercial is scheduled to run.
NextAdAt time.Time `json:"next_ad_at"`
// LastAdAt is the UTC timestamp for when the last commercial ran.
LastAdAt time.Time `json:"last_ad_at"`
}
AdSchedule represents the ad schedule for a broadcaster.
type AdScheduleListCall ¶ added in v0.4.0
type AdScheduleListCall struct {
// contains filtered or unexported fields
}
AdScheduleListCall represents a GET call to a Twitch Ads API endpoint.
func (*AdScheduleListCall) BroadcasterID ¶ added in v0.4.0
func (api *AdScheduleListCall) BroadcasterID(broadcasterID string) *AdScheduleListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*AdScheduleListCall) Do ¶ added in v0.4.0
func (api *AdScheduleListCall) Do(ctx context.Context, opts ...RequestOption) (*AdScheduleListResponse, error)
Do executes the request.
type AdScheduleListResponse ¶ added in v0.4.0
type AdScheduleListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the AdSchedule data returned by the Twitch API.
Data []AdSchedule
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
AdScheduleListResponse represents the response from a GET request to /helix/channels/ads.
type AdsResource ¶
type AdsResource struct {
// Snooze provides access to the Twitch Snooze API.
Snooze *AdsSnoozeResource
// contains filtered or unexported fields
}
AdsResource represents the Twitch Ads API.
func NewAdsResource ¶
func NewAdsResource(client *Client) *AdsResource
NewAdsResource creates a new AdsResource.
func (*AdsResource) Insert ¶
func (r *AdsResource) Insert(broadcasterID string, length int) *StartCommercialInsertCall
Insert creates a new POST request to /helix/channels/commercial.
Starts a commercial on the specified channel.
Only Twitch Partners and Affiliates can run commercials on their channels and must be live.
Authorization ¶
Requires the broadcasters access token that includes the channel:edit:commercial scope.
Check the Official Twitch Documentation for more information.
func (*AdsResource) List ¶ added in v0.4.0
func (r *AdsResource) List(broadcasterID string) *AdScheduleListCall
List creates a new GET request to /helix/channels/ads.
Gets ad schedule related information, including snooze, when the last ad was run, when the next ad is scheduled, and if the channel is currently in pre-roll free time.
Authorization ¶
Requires a user access token that includes the channel:read:ads scope. The user_id in the user access token must match the broadcaster_id.
Check the Official Twitch Documentation for more information.
type AdsSnoozeResource ¶
type AdsSnoozeResource struct {
// contains filtered or unexported fields
}
AdsSnoozeResource represents the Twitch AdsSnooze API.
func NewAdsSnoozeResource ¶
func NewAdsSnoozeResource(client *Client) *AdsSnoozeResource
NewAdsSnoozeResource creates a new AdsSnoozeResource.
func (*AdsSnoozeResource) Insert ¶
func (r *AdsSnoozeResource) Insert(broadcasterID string) *SnoozeNextAdInsertCall
Insert creates a new POST request to /helix/channels/ads/schedule/snooze.
If available, pushes back the timestamp of the upcoming automatic mid-roll ad by 5 minutes.
Authorization ¶
Requires a user access token that includes the channel:manage:ads scope. The user_id in the user access token must match the broadcaster_id.
Check the Official Twitch Documentation for more information.
type AdsSnoozed ¶ added in v0.4.0
type AdsSnoozed struct {
// SnoozeCount is the number of snoozes the broadcaster has available.
SnoozeCount int `json:"snooze_count"`
// SnoozeRefreshAt is the UTC timestamp for when the broadcaster will receive another snooze.
SnoozeRefreshAt time.Time `json:"snooze_refresh_at"`
// NextAdAt is the UTC timestamp for when the next commercial is scheduled to run.
NextAdAt time.Time `json:"next_ad_at"`
}
AdsSnoozed represents the result of a successful ad snooze request.
type AnalyticsExtensionsResource ¶ added in v0.4.0
type AnalyticsExtensionsResource struct {
// contains filtered or unexported fields
}
AnalyticsExtensionsResource represents the Twitch AnalyticsExtensions API.
func NewAnalyticsExtensionsResource ¶ added in v0.4.0
func NewAnalyticsExtensionsResource(client *Client) *AnalyticsExtensionsResource
NewAnalyticsExtensionsResource creates a new AnalyticsExtensionsResource.
func (*AnalyticsExtensionsResource) List ¶ added in v0.4.0
func (r *AnalyticsExtensionsResource) List() *ExtensionAnalyticsListCall
List creates a new GET request to /helix/analytics/extensions.
Gets an analytics report for one or more extensions. The response contains the URLs used to download the reports (CSV files).
Authorization ¶
Requires a user access token that includes the analytics:read:extensions scope.
Check the Official Twitch Documentation for more information.
type AnalyticsGamesResource ¶ added in v0.4.0
type AnalyticsGamesResource struct {
// contains filtered or unexported fields
}
AnalyticsGamesResource represents the Twitch AnalyticsGames API.
func NewAnalyticsGamesResource ¶ added in v0.4.0
func NewAnalyticsGamesResource(client *Client) *AnalyticsGamesResource
NewAnalyticsGamesResource creates a new AnalyticsGamesResource.
func (*AnalyticsGamesResource) List ¶ added in v0.4.0
func (r *AnalyticsGamesResource) List() *GameAnalyticsListCall
List creates a new GET request to /helix/analytics/games.
Gets an analytics report for one or more games. The response contains the URLs used to download the reports (CSV files).
Authorization ¶
Requires a user access token that includes the analytics:read:games scope.
Check the Official Twitch Documentation for more information.
type AnalyticsResource ¶
type AnalyticsResource struct {
// Extensions provides access to the Twitch Extensions API.
Extensions *AnalyticsExtensionsResource
// Games provides access to the Twitch Games API.
Games *AnalyticsGamesResource
// contains filtered or unexported fields
}
AnalyticsResource represents the Twitch Analytics API.
func NewAnalyticsResource ¶
func NewAnalyticsResource(client *Client) *AnalyticsResource
NewAnalyticsResource creates a new AnalyticsResource.
type Authorization ¶ added in v0.4.2
type Authorization interface {
Client(ctx context.Context) *http.Client
TokenSource(ctx context.Context) oauth2.TokenSource
Token(ctx context.Context) (*oauth2.Token, error)
}
Authorization provides methods to authenticate with the Twitch API.
func AppAccess ¶ added in v0.4.2
func AppAccess(clientID, clientSecret string) Authorization
AppAccess returns an Authorization that maintains a Twitch API app access token.
func UserToken ¶ added in v0.4.2
func UserToken(config *oauth2.Config, token *oauth2.Token) Authorization
UserToken returns an Authorization that maintains a Twitch API user access token.
type AuthorizationListCall ¶ added in v0.4.1
type AuthorizationListCall struct {
// contains filtered or unexported fields
}
AuthorizationListCall represents a GET call to a Twitch UsersAuthorization API endpoint.
func (*AuthorizationListCall) Do ¶ added in v0.4.1
func (api *AuthorizationListCall) Do(ctx context.Context, opts ...RequestOption) (*AuthorizationListResponse, error)
Do executes the request.
func (*AuthorizationListCall) UserID ¶ added in v0.4.1
func (api *AuthorizationListCall) UserID(userIDs ...string) *AuthorizationListCall
UserID adds to the UserID query parameter.
type AuthorizationListResponse ¶ added in v0.4.1
type AuthorizationListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the UserAuthorization data returned by the Twitch API.
Data []UserAuthorization
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
AuthorizationListResponse represents the response from a GET request to /helix/authorization/users.
type AutoModSettings ¶ added in v0.4.0
type AutoModSettings struct {
// BroadcasterID is the ID of the broadcaster whose AutoMod settings are being managed.
BroadcasterID string `json:"broadcaster_id"`
// ModeratorID is the ID of the moderator managing the AutoMod settings.
ModeratorID string `json:"moderator_id"`
// OverallLevel is the overall AutoMod level setting.
OverallLevel int `json:"overall_level"`
// Ableism is the AutoMod level setting for messages containing references to disability.
Ableism int `json:"disability"`
// Aggressive is the AutoMod level setting for messages containing aggressive content.
Aggressive int `json:"aggression"`
// SexualDiscrimination is the AutoMod level setting for messages containing discrimination based on sexuality, sex, or gender.
SexualDiscrimination int `json:"sexuality_sex_or_gender"`
// MysogynySexism is the AutoMod level setting for messages containing misogynistic or sexist language.
MisogynySexism int `json:"misogyny"`
// Bullying is the AutoMod level setting for messages containing bullying or harassment.
Bullying int `json:"bullying"`
// Swearing is the AutoMod level setting for messages containing swearing or profanity.
Swearing int `json:"swearing"`
// RacismEthnicity is the AutoMod level setting for messages containing racism or ethnic discrimination.
RacismEthnicity int `json:"race_ethnicity_or_religion"`
// SexualTerms is the AutoMod level setting for messages containing sexual content or innuendo.
SexualTerms int `json:"sex_based_terms"`
}
AutoModSettings represents the AutoMod settings for a Twitch channel.
type AutoModStatus ¶ added in v0.4.0
type AutoModStatus struct {
// MessageID is the ID of the message being reviewed.
MessageID string `json:"msg_id"`
// Permitted indicates whether the message would be permitted or blocked by AutoMod.
Permitted bool `json:"is_permitted"`
}
AutoModStatus represents the status of an AutoMod message review.
type BanUserInsertCall ¶ added in v0.4.0
type BanUserInsertCall struct {
// contains filtered or unexported fields
}
BanUserInsertCall represents a POST call to a Twitch ModerationBans API endpoint.
func (*BanUserInsertCall) Ban ¶ added in v0.4.0
func (api *BanUserInsertCall) Ban(ban OutboundBan) *BanUserInsertCall
Ban sets the Ban body parameter.
func (*BanUserInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *BanUserInsertCall) BroadcasterID(broadcasterID string) *BanUserInsertCall
BroadcasterID sets the BroadcasterID query parameter.
func (*BanUserInsertCall) Do ¶ added in v0.4.0
func (api *BanUserInsertCall) Do(ctx context.Context, opts ...RequestOption) (*BanUserInsertResponse, error)
Do executes the request.
func (*BanUserInsertCall) ModeratorID ¶ added in v0.4.0
func (api *BanUserInsertCall) ModeratorID(moderatorID string) *BanUserInsertCall
ModeratorID sets the ModeratorID query parameter.
type BanUserInsertResponse ¶ added in v0.4.0
type BanUserInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the IssuedBan data returned by the Twitch API.
Data []IssuedBan
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
BanUserInsertResponse represents the response from a POST request to /helix/moderation/bans.
type BannedUser ¶ added in v0.4.0
type BannedUser struct {
// ModeratorID is the ID of the moderator who issued the ban.
ModeratorID string `json:"moderator_id"`
// ModeratorLogin is the login name of the moderator who issued the ban.
ModeratorLogin string `json:"moderator_login"`
// ModeratorName is the display name of the moderator who issued the ban.
ModeratorName string `json:"moderator_name"`
// UserID is the ID of the user who was banned.
UserID string `json:"user_id"`
// UserLogin is the login name of the user who was banned.
UserLogin string `json:"user_login"`
// UserName is the display name of the user who was banned.
UserName string `json:"user_name"`
// Reason is the reason the user was banned.
Reason string `json:"reason"`
// CreatedAt is the UTC timestamp of when the ban was issued.
CreatedAt time.Time `json:"created_at"`
// ExpiresAt is the UTC timestamp of when the ban expires, if applicable.
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
BannedUser represents a user who has been banned from a Twitch channel.
type BitsCheermotesListCall ¶ added in v0.4.0
type BitsCheermotesListCall struct {
// contains filtered or unexported fields
}
BitsCheermotesListCall represents a GET call to a Twitch BitsCheermotes API endpoint.
func (*BitsCheermotesListCall) BroadcasterID ¶ added in v0.4.0
func (api *BitsCheermotesListCall) BroadcasterID(broadcasterID string) *BitsCheermotesListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*BitsCheermotesListCall) Do ¶ added in v0.4.0
func (api *BitsCheermotesListCall) Do(ctx context.Context, opts ...RequestOption) (*BitsCheermotesListResponse, error)
Do executes the request.
type BitsCheermotesListResponse ¶ added in v0.4.0
type BitsCheermotesListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Cheermote data returned by the Twitch API.
Data []Cheermote
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
BitsCheermotesListResponse represents the response from a GET request to /helix/bits/cheermotes.
type BitsCheermotesResource ¶ added in v0.4.0
type BitsCheermotesResource struct {
// contains filtered or unexported fields
}
BitsCheermotesResource represents the Twitch BitsCheermotes API.
func NewBitsCheermotesResource ¶ added in v0.4.0
func NewBitsCheermotesResource(client *Client) *BitsCheermotesResource
NewBitsCheermotesResource creates a new BitsCheermotesResource.
func (*BitsCheermotesResource) List ¶ added in v0.4.0
func (r *BitsCheermotesResource) List() *BitsCheermotesListCall
List creates a new GET request to /helix/bits/cheermotes.
Gets a list of Cheermotes that users can use to cheer Bits in any Bits-enabled chat room.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type BitsExtensionTransactionsListCall ¶ added in v0.4.0
type BitsExtensionTransactionsListCall struct {
// contains filtered or unexported fields
}
BitsExtensionTransactionsListCall represents a GET call to a Twitch BitsExtensions API endpoint.
func (*BitsExtensionTransactionsListCall) After ¶ added in v0.4.0
func (api *BitsExtensionTransactionsListCall) After(after string) *BitsExtensionTransactionsListCall
After sets the After query parameter.
func (*BitsExtensionTransactionsListCall) Do ¶ added in v0.4.0
func (api *BitsExtensionTransactionsListCall) Do(ctx context.Context, opts ...RequestOption) (*BitsExtensionTransactionsListResponse, error)
Do executes the request.
func (*BitsExtensionTransactionsListCall) ExtensionID ¶ added in v0.4.0
func (api *BitsExtensionTransactionsListCall) ExtensionID(extensionID string) *BitsExtensionTransactionsListCall
ExtensionID sets the ExtensionID query parameter.
func (*BitsExtensionTransactionsListCall) First ¶ added in v0.4.0
func (api *BitsExtensionTransactionsListCall) First(first int) *BitsExtensionTransactionsListCall
First sets the First query parameter.
func (*BitsExtensionTransactionsListCall) ID ¶ added in v0.4.0
func (api *BitsExtensionTransactionsListCall) ID(ids ...string) *BitsExtensionTransactionsListCall
ID adds to the ID query parameter.
type BitsExtensionTransactionsListResponse ¶ added in v0.4.0
type BitsExtensionTransactionsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ExtensionTransaction data returned by the Twitch API.
Data []ExtensionTransaction
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
BitsExtensionTransactionsListResponse represents the response from a GET request to /helix/extensions/transactions.
type BitsExtensionsResource ¶ added in v0.4.0
type BitsExtensionsResource struct {
// contains filtered or unexported fields
}
BitsExtensionsResource represents the Twitch BitsExtensions API.
func NewBitsExtensionsResource ¶ added in v0.4.0
func NewBitsExtensionsResource(client *Client) *BitsExtensionsResource
NewBitsExtensionsResource creates a new BitsExtensionsResource.
func (*BitsExtensionsResource) List ¶ added in v0.4.0
func (r *BitsExtensionsResource) List(extensionID string) *BitsExtensionTransactionsListCall
List creates a new GET request to /helix/extensions/transactions.
Gets a list of transactions for an extension. A transaction records the exchange of a currency (for example, Bits) for a digital product.
Authorization ¶
Requires an app access token.
Check the Official Twitch Documentation for more information.
type BitsLeaderboardEntry ¶
type BitsLeaderboardEntry struct {
// UserID is the ID of the user.
UserID string `json:"user_id"`
// UserLogin is the login name of the user.
UserLogin string `json:"user_login"`
// UserName is the display name of the user.
UserName string `json:"user_name"`
// Rank is the leaderboard rank for the user in the channel.
Rank int `json:"rank"`
// Score is the total number of bits the user has spent in the channel.
Score int `json:"score"`
}
BitsLeaderboardEntry represents a leaderboard of users who have spent the most bits in a channel.
type BitsLeaderboardListCall ¶
type BitsLeaderboardListCall struct {
// contains filtered or unexported fields
}
BitsLeaderboardListCall represents a GET call to a Twitch BitsLeaderboard API endpoint.
func (*BitsLeaderboardListCall) Count ¶
func (api *BitsLeaderboardListCall) Count(count int) *BitsLeaderboardListCall
Count sets the Count query parameter.
func (*BitsLeaderboardListCall) Do ¶
func (api *BitsLeaderboardListCall) Do(ctx context.Context, opts ...RequestOption) (*BitsLeaderboardListResponse, error)
Do executes the request.
func (*BitsLeaderboardListCall) Period ¶
func (api *BitsLeaderboardListCall) Period(period string) *BitsLeaderboardListCall
Period sets the Period query parameter.
func (*BitsLeaderboardListCall) StartedAt ¶
func (api *BitsLeaderboardListCall) StartedAt(startedAt time.Time) *BitsLeaderboardListCall
StartedAt sets the StartedAt query parameter.
func (*BitsLeaderboardListCall) UserID ¶
func (api *BitsLeaderboardListCall) UserID(userID string) *BitsLeaderboardListCall
UserID sets the UserID query parameter.
type BitsLeaderboardListResponse ¶
type BitsLeaderboardListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Total is the int data returned by the Twitch API.
Total int
// Data is the BitsLeaderboardEntry data returned by the Twitch API.
Data []BitsLeaderboardEntry
// DateRange is the DateRange data returned by the Twitch API.
DateRange DateRange
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
BitsLeaderboardListResponse represents the response from a GET request to /helix/bits/leaderboard.
type BitsLeaderboardResource ¶
type BitsLeaderboardResource struct {
// contains filtered or unexported fields
}
BitsLeaderboardResource represents the Twitch BitsLeaderboard API.
func NewBitsLeaderboardResource ¶
func NewBitsLeaderboardResource(client *Client) *BitsLeaderboardResource
NewBitsLeaderboardResource creates a new BitsLeaderboardResource.
func (*BitsLeaderboardResource) List ¶
func (r *BitsLeaderboardResource) List() *BitsLeaderboardListCall
List creates a new GET request to /helix/bits/leaderboard.
Gets the Bits leaderboard for the authenticated broadcaster.
Authorization ¶
Requires a user access token that includes the bits:read scope.
Check the Official Twitch Documentation for more information.
type BitsResource ¶
type BitsResource struct {
// Cheermotes provides access to the Twitch Cheermotes API.
Cheermotes *BitsCheermotesResource
// Extensions provides access to the Twitch Extensions API.
Extensions *BitsExtensionsResource
// Leaderboard provides access to the Twitch Leaderboard API.
Leaderboard *BitsLeaderboardResource
// contains filtered or unexported fields
}
BitsResource represents the Twitch Bits API.
func NewBitsResource ¶
func NewBitsResource(client *Client) *BitsResource
NewBitsResource creates a new BitsResource.
type BlockedTerm ¶ added in v0.4.0
type BlockedTerm struct {
// ID is the ID that uniquely identifies the blocked term.
ID string `json:"id"`
// BroadcasterID is the ID of the broadcaster the blocked term belongs to.
BroadcasterID string `json:"broadcaster_id"`
// ModeratorID is the ID of the moderator that blocked the term.
ModeratorID string `json:"moderator_id"`
// Text is the blocked term.
Text string `json:"text"`
// CreatedAt is the UTC timestamp of when the blocked term was created.
CreatedAt time.Time `json:"created_at"`
// UpdatedAt is the UTC timestamp of when the blocked term was last updated.
UpdatedAt time.Time `json:"updated_at"`
// ExpiresAt is the UTC timestamp of when the blocked term expires, if applicable.
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
BlockedTerm represents a term that has been blocked in a Twitch channel.
type BroadcasterSubscriptionsListCall ¶ added in v0.4.0
type BroadcasterSubscriptionsListCall struct {
// contains filtered or unexported fields
}
BroadcasterSubscriptionsListCall represents a GET call to a Twitch Subscriptions API endpoint.
func (*BroadcasterSubscriptionsListCall) After ¶ added in v0.4.0
func (api *BroadcasterSubscriptionsListCall) After(after string) *BroadcasterSubscriptionsListCall
After sets the After query parameter.
func (*BroadcasterSubscriptionsListCall) Before ¶ added in v0.4.0
func (api *BroadcasterSubscriptionsListCall) Before(before string) *BroadcasterSubscriptionsListCall
Before sets the Before query parameter.
func (*BroadcasterSubscriptionsListCall) BroadcasterID ¶ added in v0.4.0
func (api *BroadcasterSubscriptionsListCall) BroadcasterID(broadcasterID string) *BroadcasterSubscriptionsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*BroadcasterSubscriptionsListCall) Do ¶ added in v0.4.0
func (api *BroadcasterSubscriptionsListCall) Do(ctx context.Context, opts ...RequestOption) (*BroadcasterSubscriptionsListResponse, error)
Do executes the request.
func (*BroadcasterSubscriptionsListCall) First ¶ added in v0.4.0
func (api *BroadcasterSubscriptionsListCall) First(first int) *BroadcasterSubscriptionsListCall
First sets the First query parameter.
func (*BroadcasterSubscriptionsListCall) UserID ¶ added in v0.4.0
func (api *BroadcasterSubscriptionsListCall) UserID(userIDs ...string) *BroadcasterSubscriptionsListCall
UserID adds to the UserID query parameter.
type BroadcasterSubscriptionsListResponse ¶ added in v0.4.0
type BroadcasterSubscriptionsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Total is the int data returned by the Twitch API.
Total int
// Points is the int data returned by the Twitch API.
Points int
// Data is the ChannelSubscription data returned by the Twitch API.
Data []ChannelSubscription
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
BroadcasterSubscriptionsListResponse represents the response from a GET request to /helix/subscriptions.
type CategorySearchResult ¶ added in v0.4.0
type CategorySearchResult struct {
// ID is the ID that uniquely identifies the category.
ID string `json:"id"`
// Name is the name of the category.
Name string `json:"name"`
// BoxArtURL is the URL to the box art of the category.
BoxArtURL string `json:"box_art_url"`
}
CategorySearchResult represents a search result for a Twitch category.
type Channel ¶
type Channel struct {
// GameID is the ID of the game being played on the channel.
GameID string `json:"game_id"`
// GameName is the name of the game being played on the channel.
GameName string `json:"game_name"`
// BroadcasterID is the ID of the broadcaster.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster.
BroadcasterName string `json:"broadcaster_name"`
// BroadcasterLanguage is the language of the broadcaster.
BroadcasterLanguage string `json:"broadcaster_language"`
// Title is stream title for the channel.
Title string `json:"title"`
// Delay is the delay of the stream in seconds.
Delay int `json:"delay"`
// Tags are the tags applied to the channel.
Tags []string `json:"tags"`
// ContentClassificationLabels are the CCLs applied to the channel.
ContentClassificationLabels []string `json:"content_classification_labels"`
// IsBrandedContent indicates whether the channel is marked as branded content such as sponorships.
IsBrandedContent bool `json:"is_branded_content"`
}
Channel represents a Twitch channel.
type ChannelChatBadgesListCall ¶ added in v0.4.0
type ChannelChatBadgesListCall struct {
// contains filtered or unexported fields
}
ChannelChatBadgesListCall represents a GET call to a Twitch ChatBadges API endpoint.
func (*ChannelChatBadgesListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelChatBadgesListCall) BroadcasterID(broadcasterID string) *ChannelChatBadgesListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelChatBadgesListCall) Do ¶ added in v0.4.0
func (api *ChannelChatBadgesListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelChatBadgesListResponse, error)
Do executes the request.
type ChannelChatBadgesListResponse ¶ added in v0.4.0
type ChannelChatBadgesListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ChatBadge data returned by the Twitch API.
Data []ChatBadge
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelChatBadgesListResponse represents the response from a GET request to /helix/chat/badges.
type ChannelContentClassificationLabel ¶ added in v0.4.0
type ChannelContentClassificationLabel struct {
// ID is the ID of the content classification label.
ID string `json:"id"`
// IsEnabled indicates whether the content classification label is enabled.
IsEnabled bool `json:"is_enabled"`
}
ChannelContentClassificationLabel represents a content classification label.
type ChannelEditor ¶ added in v0.4.0
type ChannelEditor struct {
// UserID is the ID of the user who is an editor of the channel.
UserID string `json:"user_id"`
// UserName is the display name of the user who is an editor of the channel.
UserName string `json:"user_name"`
// AddedAt is the UTC timestamp of when the user was added as an editor of the channel.
AddedAt time.Time `json:"created_at"`
}
ChannelEditor represents a user who is an editor of a Twitch channel.
type ChannelEditorsListCall ¶ added in v0.4.0
type ChannelEditorsListCall struct {
// contains filtered or unexported fields
}
ChannelEditorsListCall represents a GET call to a Twitch ChannelsEditors API endpoint.
func (*ChannelEditorsListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelEditorsListCall) BroadcasterID(broadcasterID string) *ChannelEditorsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelEditorsListCall) Do ¶ added in v0.4.0
func (api *ChannelEditorsListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelEditorsListResponse, error)
Do executes the request.
type ChannelEditorsListResponse ¶ added in v0.4.0
type ChannelEditorsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ChannelEditor data returned by the Twitch API.
Data []ChannelEditor
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelEditorsListResponse represents the response from a GET request to /helix/channels/editors.
type ChannelEmotesListCall ¶ added in v0.4.0
type ChannelEmotesListCall struct {
// contains filtered or unexported fields
}
ChannelEmotesListCall represents a GET call to a Twitch ChatEmotesChannel API endpoint.
func (*ChannelEmotesListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelEmotesListCall) BroadcasterID(broadcasterID string) *ChannelEmotesListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelEmotesListCall) Do ¶ added in v0.4.0
func (api *ChannelEmotesListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelEmotesListResponse, error)
Do executes the request.
type ChannelEmotesListResponse ¶ added in v0.4.0
type ChannelEmotesListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Emote data returned by the Twitch API.
Data []Emote
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelEmotesListResponse represents the response from a GET request to /helix/chat/emotes.
type ChannelFollowersListCall ¶ added in v0.4.0
type ChannelFollowersListCall struct {
// contains filtered or unexported fields
}
ChannelFollowersListCall represents a GET call to a Twitch ChannelsFollowers API endpoint.
func (*ChannelFollowersListCall) After ¶ added in v0.4.0
func (api *ChannelFollowersListCall) After(after string) *ChannelFollowersListCall
After sets the After query parameter.
func (*ChannelFollowersListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelFollowersListCall) BroadcasterID(broadcasterID string) *ChannelFollowersListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelFollowersListCall) Do ¶ added in v0.4.0
func (api *ChannelFollowersListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelFollowersListResponse, error)
Do executes the request.
func (*ChannelFollowersListCall) First ¶ added in v0.4.0
func (api *ChannelFollowersListCall) First(first int) *ChannelFollowersListCall
First sets the First query parameter.
func (*ChannelFollowersListCall) UserID ¶ added in v0.4.0
func (api *ChannelFollowersListCall) UserID(userID string) *ChannelFollowersListCall
UserID sets the UserID query parameter.
type ChannelFollowersListResponse ¶ added in v0.4.0
type ChannelFollowersListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Total is the int data returned by the Twitch API.
Total int
// Data is the Follower data returned by the Twitch API.
Data []Follower
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelFollowersListResponse represents the response from a GET request to /helix/channels/followers.
type ChannelGuestStarSettings ¶ added in v0.4.0
type ChannelGuestStarSettings struct {
// GroupLayout is the layout of the guest star group.
GroupLayout string `json:"group_layout"`
// BrowserSourceToken is the token used to authenticate the browser source for guest stars.
BrowserSourceToken string `json:"browser_source_token"`
// IsBrowserSourceEnabled indicates whether the browser source for guest stars is enabled.
IsBrowserSourceAudioEnabled bool `json:"is_browser_source_audio_enabled"`
// IsModeratorSendLiveEnabled indicates whether moderators can send live invitations to guest stars.
IsModeratorSendLiveEnabled bool `json:"is_moderator_send_live_enabled"`
// SlotCount is the number of slots available for guest stars.
SlotCount int `json:"slot_count"`
}
ChannelGuestStarSettings represents the guest star settings for a Twitch channel.
type ChannelInformationListCall ¶ added in v0.4.0
type ChannelInformationListCall struct {
// contains filtered or unexported fields
}
ChannelInformationListCall represents a GET call to a Twitch Channels API endpoint.
func (*ChannelInformationListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelInformationListCall) BroadcasterID(broadcasterIDs ...string) *ChannelInformationListCall
BroadcasterID adds to the BroadcasterID query parameter.
func (*ChannelInformationListCall) Do ¶ added in v0.4.0
func (api *ChannelInformationListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelInformationListResponse, error)
Do executes the request.
type ChannelInformationListResponse ¶ added in v0.4.0
type ChannelInformationListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Channel data returned by the Twitch API.
Data []Channel
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelInformationListResponse represents the response from a GET request to /helix/channels.
type ChannelInformationModifyCall ¶ added in v0.4.0
type ChannelInformationModifyCall struct {
// contains filtered or unexported fields
}
ChannelInformationModifyCall represents a PATCH call to a Twitch Channels API endpoint.
func (*ChannelInformationModifyCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelInformationModifyCall) BroadcasterID(broadcasterID string) *ChannelInformationModifyCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelInformationModifyCall) BroadcasterLanguage ¶ added in v0.4.0
func (api *ChannelInformationModifyCall) BroadcasterLanguage(broadcasterLanguage string) *ChannelInformationModifyCall
BroadcasterLanguage sets the BroadcasterLanguage body parameter.
func (*ChannelInformationModifyCall) ContentClassificationLabels ¶ added in v0.4.0
func (api *ChannelInformationModifyCall) ContentClassificationLabels(contentClassificationLabelss ...ChannelContentClassificationLabel) *ChannelInformationModifyCall
ContentClassificationLabels sets the ContentClassificationLabels body parameter.
func (*ChannelInformationModifyCall) Delay ¶ added in v0.4.0
func (api *ChannelInformationModifyCall) Delay(delay int) *ChannelInformationModifyCall
Delay sets the Delay body parameter.
func (*ChannelInformationModifyCall) Do ¶ added in v0.4.0
func (api *ChannelInformationModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelInformationModifyResponse, error)
Do executes the request.
func (*ChannelInformationModifyCall) GameID ¶ added in v0.4.0
func (api *ChannelInformationModifyCall) GameID(gameID string) *ChannelInformationModifyCall
GameID sets the GameID body parameter.
func (*ChannelInformationModifyCall) IsBrandedContent ¶ added in v0.4.0
func (api *ChannelInformationModifyCall) IsBrandedContent(isBrandedContent bool) *ChannelInformationModifyCall
IsBrandedContent sets the IsBrandedContent body parameter.
func (*ChannelInformationModifyCall) Tags ¶ added in v0.4.0
func (api *ChannelInformationModifyCall) Tags(tagss ...string) *ChannelInformationModifyCall
Tags sets the Tags body parameter.
func (*ChannelInformationModifyCall) Title ¶ added in v0.4.0
func (api *ChannelInformationModifyCall) Title(title string) *ChannelInformationModifyCall
Title sets the Title body parameter.
type ChannelInformationModifyResponse ¶ added in v0.4.0
type ChannelInformationModifyResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelInformationModifyResponse represents the response from a PATCH request to /helix/channels.
type ChannelPointRedemptionsListCall ¶ added in v0.4.0
type ChannelPointRedemptionsListCall struct {
// contains filtered or unexported fields
}
ChannelPointRedemptionsListCall represents a GET call to a Twitch ChannelPointsRedemptions API endpoint.
func (*ChannelPointRedemptionsListCall) After ¶ added in v0.4.0
func (api *ChannelPointRedemptionsListCall) After(after string) *ChannelPointRedemptionsListCall
After sets the After query parameter.
func (*ChannelPointRedemptionsListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelPointRedemptionsListCall) BroadcasterID(broadcasterID string) *ChannelPointRedemptionsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelPointRedemptionsListCall) Do ¶ added in v0.4.0
func (api *ChannelPointRedemptionsListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRedemptionsListResponse, error)
Do executes the request.
func (*ChannelPointRedemptionsListCall) First ¶ added in v0.4.0
func (api *ChannelPointRedemptionsListCall) First(first int) *ChannelPointRedemptionsListCall
First sets the First query parameter.
func (*ChannelPointRedemptionsListCall) ID ¶ added in v0.4.0
func (api *ChannelPointRedemptionsListCall) ID(id string) *ChannelPointRedemptionsListCall
ID sets the ID query parameter.
func (*ChannelPointRedemptionsListCall) RewardID ¶ added in v0.4.0
func (api *ChannelPointRedemptionsListCall) RewardID(rewardID string) *ChannelPointRedemptionsListCall
RewardID sets the RewardID query parameter.
func (*ChannelPointRedemptionsListCall) Sort ¶ added in v0.4.0
func (api *ChannelPointRedemptionsListCall) Sort(sort string) *ChannelPointRedemptionsListCall
Sort sets the Sort query parameter.
func (*ChannelPointRedemptionsListCall) Status ¶ added in v0.4.0
func (api *ChannelPointRedemptionsListCall) Status(status string) *ChannelPointRedemptionsListCall
Status sets the Status query parameter.
type ChannelPointRedemptionsListResponse ¶ added in v0.4.0
type ChannelPointRedemptionsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the CustomRewardRedemption data returned by the Twitch API.
Data []CustomRewardRedemption
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelPointRedemptionsListResponse represents the response from a GET request to /helix/channel_points/custom_rewards/redemptions.
type ChannelPointRedemptionsModifyCall ¶ added in v0.4.0
type ChannelPointRedemptionsModifyCall struct {
// contains filtered or unexported fields
}
ChannelPointRedemptionsModifyCall represents a PATCH call to a Twitch ChannelPointsRedemptions API endpoint.
func (*ChannelPointRedemptionsModifyCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelPointRedemptionsModifyCall) BroadcasterID(broadcasterID string) *ChannelPointRedemptionsModifyCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelPointRedemptionsModifyCall) Do ¶ added in v0.4.0
func (api *ChannelPointRedemptionsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRedemptionsModifyResponse, error)
Do executes the request.
func (*ChannelPointRedemptionsModifyCall) ID ¶ added in v0.4.0
func (api *ChannelPointRedemptionsModifyCall) ID(ids ...string) *ChannelPointRedemptionsModifyCall
ID adds to the ID query parameter.
func (*ChannelPointRedemptionsModifyCall) RewardID ¶ added in v0.4.0
func (api *ChannelPointRedemptionsModifyCall) RewardID(rewardID string) *ChannelPointRedemptionsModifyCall
RewardID sets the RewardID query parameter.
type ChannelPointRedemptionsModifyResponse ¶ added in v0.4.0
type ChannelPointRedemptionsModifyResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the CustomRewardRedemption data returned by the Twitch API.
Data []CustomRewardRedemption
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelPointRedemptionsModifyResponse represents the response from a PATCH request to /helix/channel_points/custom_rewards/redemptions.
type ChannelPointRewardsDeleteCall ¶ added in v0.4.0
type ChannelPointRewardsDeleteCall struct {
// contains filtered or unexported fields
}
ChannelPointRewardsDeleteCall represents a DELETE call to a Twitch ChannelPointsRewards API endpoint.
func (*ChannelPointRewardsDeleteCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelPointRewardsDeleteCall) BroadcasterID(broadcasterID string) *ChannelPointRewardsDeleteCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelPointRewardsDeleteCall) Do ¶ added in v0.4.0
func (api *ChannelPointRewardsDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRewardsDeleteResponse, error)
Do executes the request.
func (*ChannelPointRewardsDeleteCall) ID ¶ added in v0.4.0
func (api *ChannelPointRewardsDeleteCall) ID(id string) *ChannelPointRewardsDeleteCall
ID sets the ID query parameter.
type ChannelPointRewardsDeleteResponse ¶ added in v0.4.0
type ChannelPointRewardsDeleteResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelPointRewardsDeleteResponse represents the response from a DELETE request to /helix/channel_points/custom_rewards.
type ChannelPointRewardsInsertCall ¶ added in v0.4.0
type ChannelPointRewardsInsertCall struct {
// contains filtered or unexported fields
}
ChannelPointRewardsInsertCall represents a POST call to a Twitch ChannelPointsRewards API endpoint.
func (*ChannelPointRewardsInsertCall) BackgroundColor ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) BackgroundColor(backgroundColor string) *ChannelPointRewardsInsertCall
BackgroundColor sets the BackgroundColor body parameter.
func (*ChannelPointRewardsInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) BroadcasterID(broadcasterID string) *ChannelPointRewardsInsertCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelPointRewardsInsertCall) Cost ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) Cost(cost int64) *ChannelPointRewardsInsertCall
Cost sets the Cost body parameter.
func (*ChannelPointRewardsInsertCall) Do ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRewardsInsertResponse, error)
Do executes the request.
func (*ChannelPointRewardsInsertCall) GlobalCooldownSeconds ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) GlobalCooldownSeconds(globalCooldownSeconds int) *ChannelPointRewardsInsertCall
GlobalCooldownSeconds sets the GlobalCooldownSeconds body parameter.
func (*ChannelPointRewardsInsertCall) IsEnabled ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) IsEnabled(isEnabled bool) *ChannelPointRewardsInsertCall
IsEnabled sets the IsEnabled body parameter.
func (*ChannelPointRewardsInsertCall) IsGlobalCooldownEnabled ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) IsGlobalCooldownEnabled(isGlobalCooldownEnabled bool) *ChannelPointRewardsInsertCall
IsGlobalCooldownEnabled sets the IsGlobalCooldownEnabled body parameter.
func (*ChannelPointRewardsInsertCall) IsMaxPerStreamEnabled ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) IsMaxPerStreamEnabled(isMaxPerStreamEnabled bool) *ChannelPointRewardsInsertCall
IsMaxPerStreamEnabled sets the IsMaxPerStreamEnabled body parameter.
func (*ChannelPointRewardsInsertCall) IsMaxPerUserPerStreamEnabled ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) IsMaxPerUserPerStreamEnabled(isMaxPerUserPerStreamEnabled bool) *ChannelPointRewardsInsertCall
IsMaxPerUserPerStreamEnabled sets the IsMaxPerUserPerStreamEnabled body parameter.
func (*ChannelPointRewardsInsertCall) IsUserInputRequired ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) IsUserInputRequired(isUserInputRequired bool) *ChannelPointRewardsInsertCall
IsUserInputRequired sets the IsUserInputRequired body parameter.
func (*ChannelPointRewardsInsertCall) MaxPerStream ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) MaxPerStream(maxPerStream int) *ChannelPointRewardsInsertCall
MaxPerStream sets the MaxPerStream body parameter.
func (*ChannelPointRewardsInsertCall) MaxPerUserPerStream ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) MaxPerUserPerStream(maxPerUserPerStream int) *ChannelPointRewardsInsertCall
MaxPerUserPerStream sets the MaxPerUserPerStream body parameter.
func (*ChannelPointRewardsInsertCall) Prompt ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) Prompt(prompt string) *ChannelPointRewardsInsertCall
Prompt sets the Prompt body parameter.
func (*ChannelPointRewardsInsertCall) ShouldRedemptionsSkipRequestQueue ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) ShouldRedemptionsSkipRequestQueue(shouldRedemptionsSkipRequestQueue bool) *ChannelPointRewardsInsertCall
ShouldRedemptionsSkipRequestQueue sets the ShouldRedemptionsSkipRequestQueue body parameter.
func (*ChannelPointRewardsInsertCall) Title ¶ added in v0.4.0
func (api *ChannelPointRewardsInsertCall) Title(title string) *ChannelPointRewardsInsertCall
Title sets the Title body parameter.
type ChannelPointRewardsInsertResponse ¶ added in v0.4.0
type ChannelPointRewardsInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the CustomReward data returned by the Twitch API.
Data []CustomReward
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelPointRewardsInsertResponse represents the response from a POST request to /helix/channel_points/custom_rewards.
type ChannelPointRewardsListCall ¶ added in v0.4.0
type ChannelPointRewardsListCall struct {
// contains filtered or unexported fields
}
ChannelPointRewardsListCall represents a GET call to a Twitch ChannelPointsRewards API endpoint.
func (*ChannelPointRewardsListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelPointRewardsListCall) BroadcasterID(broadcasterID string) *ChannelPointRewardsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelPointRewardsListCall) Do ¶ added in v0.4.0
func (api *ChannelPointRewardsListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRewardsListResponse, error)
Do executes the request.
func (*ChannelPointRewardsListCall) ID ¶ added in v0.4.0
func (api *ChannelPointRewardsListCall) ID(ids ...string) *ChannelPointRewardsListCall
ID adds to the ID query parameter.
func (*ChannelPointRewardsListCall) OnlyManageableRewards ¶ added in v0.4.0
func (api *ChannelPointRewardsListCall) OnlyManageableRewards(onlyManageableRewards bool) *ChannelPointRewardsListCall
OnlyManageableRewards sets the OnlyManageableRewards query parameter.
type ChannelPointRewardsListResponse ¶ added in v0.4.0
type ChannelPointRewardsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the CustomReward data returned by the Twitch API.
Data []CustomReward
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelPointRewardsListResponse represents the response from a GET request to /helix/channel_points/custom_rewards.
type ChannelPointRewardsModifyCall ¶ added in v0.4.0
type ChannelPointRewardsModifyCall struct {
// contains filtered or unexported fields
}
ChannelPointRewardsModifyCall represents a PATCH call to a Twitch ChannelPointsRewards API endpoint.
func (*ChannelPointRewardsModifyCall) BackgroundColor ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) BackgroundColor(backgroundColor string) *ChannelPointRewardsModifyCall
BackgroundColor sets the BackgroundColor body parameter.
func (*ChannelPointRewardsModifyCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) BroadcasterID(broadcasterID string) *ChannelPointRewardsModifyCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelPointRewardsModifyCall) Cost ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) Cost(cost int) *ChannelPointRewardsModifyCall
Cost sets the Cost body parameter.
func (*ChannelPointRewardsModifyCall) Do ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelPointRewardsModifyResponse, error)
Do executes the request.
func (*ChannelPointRewardsModifyCall) GlobalCooldownSeconds ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) GlobalCooldownSeconds(globalCooldownSeconds int) *ChannelPointRewardsModifyCall
GlobalCooldownSeconds sets the GlobalCooldownSeconds body parameter.
func (*ChannelPointRewardsModifyCall) ID ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) ID(id string) *ChannelPointRewardsModifyCall
ID sets the ID query parameter.
func (*ChannelPointRewardsModifyCall) IsEnabled ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) IsEnabled(isEnabled bool) *ChannelPointRewardsModifyCall
IsEnabled sets the IsEnabled body parameter.
func (*ChannelPointRewardsModifyCall) IsGlobalCooldownEnabled ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) IsGlobalCooldownEnabled(isGlobalCooldownEnabled bool) *ChannelPointRewardsModifyCall
IsGlobalCooldownEnabled sets the IsGlobalCooldownEnabled body parameter.
func (*ChannelPointRewardsModifyCall) IsMaxPerStreamEnabled ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) IsMaxPerStreamEnabled(isMaxPerStreamEnabled bool) *ChannelPointRewardsModifyCall
IsMaxPerStreamEnabled sets the IsMaxPerStreamEnabled body parameter.
func (*ChannelPointRewardsModifyCall) IsMaxPerUserPerStreamEnabled ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) IsMaxPerUserPerStreamEnabled(isMaxPerUserPerStreamEnabled bool) *ChannelPointRewardsModifyCall
IsMaxPerUserPerStreamEnabled sets the IsMaxPerUserPerStreamEnabled body parameter.
func (*ChannelPointRewardsModifyCall) IsPaused ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) IsPaused(isPaused bool) *ChannelPointRewardsModifyCall
IsPaused sets the IsPaused body parameter.
func (*ChannelPointRewardsModifyCall) IsUserInputRequired ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) IsUserInputRequired(isUserInputRequired bool) *ChannelPointRewardsModifyCall
IsUserInputRequired sets the IsUserInputRequired body parameter.
func (*ChannelPointRewardsModifyCall) MaxPerStream ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) MaxPerStream(maxPerStream int) *ChannelPointRewardsModifyCall
MaxPerStream sets the MaxPerStream body parameter.
func (*ChannelPointRewardsModifyCall) MaxPerUserPerStream ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) MaxPerUserPerStream(maxPerUserPerStream int) *ChannelPointRewardsModifyCall
MaxPerUserPerStream sets the MaxPerUserPerStream body parameter.
func (*ChannelPointRewardsModifyCall) Prompt ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) Prompt(prompt string) *ChannelPointRewardsModifyCall
Prompt sets the Prompt body parameter.
func (*ChannelPointRewardsModifyCall) ShouldRedemptionsSkipRequestQueue ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) ShouldRedemptionsSkipRequestQueue(shouldRedemptionsSkipRequestQueue bool) *ChannelPointRewardsModifyCall
ShouldRedemptionsSkipRequestQueue sets the ShouldRedemptionsSkipRequestQueue body parameter.
func (*ChannelPointRewardsModifyCall) Title ¶ added in v0.4.0
func (api *ChannelPointRewardsModifyCall) Title(title string) *ChannelPointRewardsModifyCall
Title sets the Title body parameter.
type ChannelPointRewardsModifyResponse ¶ added in v0.4.0
type ChannelPointRewardsModifyResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the CustomReward data returned by the Twitch API.
Data []CustomReward
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelPointRewardsModifyResponse represents the response from a PATCH request to /helix/channel_points/custom_rewards.
type ChannelPointsRedemptionsResource ¶ added in v0.4.0
type ChannelPointsRedemptionsResource struct {
// contains filtered or unexported fields
}
ChannelPointsRedemptionsResource represents the Twitch ChannelPointsRedemptions API.
func NewChannelPointsRedemptionsResource ¶ added in v0.4.0
func NewChannelPointsRedemptionsResource(client *Client) *ChannelPointsRedemptionsResource
NewChannelPointsRedemptionsResource creates a new ChannelPointsRedemptionsResource.
func (*ChannelPointsRedemptionsResource) List ¶ added in v0.4.0
func (r *ChannelPointsRedemptionsResource) List(broadcasterID string, rewardID string, status string) *ChannelPointRedemptionsListCall
List creates a new GET request to /helix/channel_points/custom_rewards/redemptions.
Gets a list of redemptions for the specified custom reward. The app used to create the reward is the only app that may get the redemptions.
Authorization ¶
Requires a user access token that includes the channel:read:redemptions or channel:manage:redemptions scope.
Check the Official Twitch Documentation for more information.
func (*ChannelPointsRedemptionsResource) Modify ¶ added in v0.4.0
func (r *ChannelPointsRedemptionsResource) Modify(id string, broadcasterID string, rewardID string) *ChannelPointRedemptionsModifyCall
Modify creates a new PATCH request to /helix/channel_points/custom_rewards/redemptions.
Updates the status for a redemption. You may update a redemption only if its status is UNFULFILLED. The app used to create the reward is the only app that may update the redemption.
Authorization ¶
Requires a user access token that includes the channel:manage:redemptions scope.
Check the Official Twitch Documentation for more information.
type ChannelPointsResource ¶
type ChannelPointsResource struct {
// Redemptions provides access to the Twitch Redemptions API.
Redemptions *ChannelPointsRedemptionsResource
// Rewards provides access to the Twitch Rewards API.
Rewards *ChannelPointsRewardsResource
// contains filtered or unexported fields
}
ChannelPointsResource represents the Twitch ChannelPoints API.
func NewChannelPointsResource ¶
func NewChannelPointsResource(client *Client) *ChannelPointsResource
NewChannelPointsResource creates a new ChannelPointsResource.
type ChannelPointsRewardsResource ¶ added in v0.4.0
type ChannelPointsRewardsResource struct {
// contains filtered or unexported fields
}
ChannelPointsRewardsResource represents the Twitch ChannelPointsRewards API.
func NewChannelPointsRewardsResource ¶ added in v0.4.0
func NewChannelPointsRewardsResource(client *Client) *ChannelPointsRewardsResource
NewChannelPointsRewardsResource creates a new ChannelPointsRewardsResource.
func (*ChannelPointsRewardsResource) Delete ¶ added in v0.4.0
func (r *ChannelPointsRewardsResource) Delete(id string, broadcasterID string) *ChannelPointRewardsDeleteCall
Delete creates a new DELETE request to /helix/channel_points/custom_rewards.
Deletes a custom reward that the broadcaster created.
The app used to create the reward is the only app that may delete it. If the redemption status for the reward is UNFULFILLED at the time the reward is deleted, its redemption status is marked as FULFILLED.
Authorization ¶
Requires a user access token that includes the channel:manage:redemptions scope.
Check the Official Twitch Documentation for more information.
func (*ChannelPointsRewardsResource) Insert ¶ added in v0.4.0
func (r *ChannelPointsRewardsResource) Insert(broadcasterID string, title string, cost int64) *ChannelPointRewardsInsertCall
Insert creates a new POST request to /helix/channel_points/custom_rewards.
Creates a new Custom Reward in a channel.
The maximum number of custom rewards per channel is 50, which includes both enabled and disabled rewards.
Authorization ¶
Requires a user access token that includes the channel:manage:redemptions scope.
Check the Official Twitch Documentation for more information.
func (*ChannelPointsRewardsResource) List ¶ added in v0.4.0
func (r *ChannelPointsRewardsResource) List(broadcasterID string) *ChannelPointRewardsListCall
List creates a new GET request to /helix/channel_points/custom_rewards.
Gets a list of custom rewards that the specified broadcaster created.
A channel may offer a maximum of 50 rewards, which includes both enabled and disabled rewards.
Authorization ¶
Requires a user access token that includes the channel:read:redemptions or channel:manage:redemptions scope.
Check the Official Twitch Documentation for more information.
func (*ChannelPointsRewardsResource) Modify ¶ added in v0.4.0
func (r *ChannelPointsRewardsResource) Modify(id string, broadcasterID string) *ChannelPointRewardsModifyCall
Modify creates a new PATCH request to /helix/channel_points/custom_rewards.
Updates a custom reward. The app used to create the reward is the only app that may update the reward.
Authorization ¶
Requires a user access token that includes the channel:manage:redemptions scope.
Check the Official Twitch Documentation for more information.
type ChannelSearchResult ¶ added in v0.4.0
type ChannelSearchResult struct {
// BroadcasterID is the ID of the broadcaster.
BroadcasterID string `json:"id"`
// BroadcasterLogin is the login name of the broadcaster.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster.
BroadcasterName string `json:"display_name"`
// BroadcasterLanguage is the language of the broadcaster.
BroadcasterLanguage string `json:"broadcaster_language"`
// GameID is the ID of the game being played on the channel.
GameID string `json:"game_id"`
// GameName is the name of the game being played on the channel.
GameName string `json:"game_name"`
// Title is the title of the channel.
Title string `json:"title"`
// ThumbnailURL is the URL to the thumbnail of the channel.
ThumbnailURL string `json:"thumbnail_url"`
// Tags is a list of tags associated with the channel.
Tags []string `json:"tag"`
// Live indicates whether the channel is currently live.
Live bool `json:"is_live"`
// Started is the UTC timestamp of when the channel went live, if applicable.
StartedAt time.Time `json:"started_at"`
}
ChannelSearchResult represents a search result for a Twitch channel.
type ChannelStreamScheduleListCall ¶ added in v0.4.0
type ChannelStreamScheduleListCall struct {
// contains filtered or unexported fields
}
ChannelStreamScheduleListCall represents a GET call to a Twitch Schedule API endpoint.
func (*ChannelStreamScheduleListCall) After ¶ added in v0.4.0
func (api *ChannelStreamScheduleListCall) After(after string) *ChannelStreamScheduleListCall
After sets the After query parameter.
func (*ChannelStreamScheduleListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelStreamScheduleListCall) BroadcasterID(broadcasterID string) *ChannelStreamScheduleListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelStreamScheduleListCall) Do ¶ added in v0.4.0
func (api *ChannelStreamScheduleListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelStreamScheduleListResponse, error)
Do executes the request.
func (*ChannelStreamScheduleListCall) First ¶ added in v0.4.0
func (api *ChannelStreamScheduleListCall) First(first int) *ChannelStreamScheduleListCall
First sets the First query parameter.
func (*ChannelStreamScheduleListCall) ID ¶ added in v0.4.0
func (api *ChannelStreamScheduleListCall) ID(id string) *ChannelStreamScheduleListCall
ID sets the ID query parameter.
func (*ChannelStreamScheduleListCall) StartTime ¶ added in v0.4.0
func (api *ChannelStreamScheduleListCall) StartTime(startTime time.Time) *ChannelStreamScheduleListCall
StartTime sets the StartTime query parameter.
type ChannelStreamScheduleListResponse ¶ added in v0.4.0
type ChannelStreamScheduleListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the StreamSchedule data returned by the Twitch API.
Data []StreamSchedule
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelStreamScheduleListResponse represents the response from a GET request to /helix/schedule.
type ChannelSubscription ¶ added in v0.4.0
type ChannelSubscription struct {
// BroadcasterID is the ID of the broadcaster that the subscription belongs to.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that the subscription belongs to.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that the subscription belongs to.
BroadcasterName string `json:"broadcaster_name"`
// UserID is the ID of the user that owns the subscription.
UserID string `json:"user_id"`
// UserLogin is the login name of the user that owns the subscription.
UserLogin string `json:"user_login"`
// UserName is the display name of the user that owns the subscription.
UserName string `json:"user_name"`
// GifterID is the ID of the user that gifted the subscription, if applicable.
GifterID string `json:"gifter_id,omitempty"`
// GifterLogin is the login name of the user that gifted the subscription, if applicable.
GifterLogin string `json:"gifter_login,omitempty"`
// GifterName is the display name of the user that gifted the subscription, if applicable.
GifterName string `json:"gifter_name,omitempty"`
// PlanName is the name of the subscription plan.
PlanName string `json:"plan_name"`
// Tier is the subscription tier.
Tier string `json:"tier"`
// IsGift indicates whether the subscription is a gift.
IsGift bool `json:"is_gift"`
}
ChannelSubscription represents a subscription to a Twitch channel.
type ChannelTeam ¶ added in v0.4.0
type ChannelTeam struct {
// ID is the ID that uniquely identifies the team.
ID string `json:"id"`
// BroadcasterID is the ID of the broadcaster that the team belongs to.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that the team belongs to.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that the team belongs to.
BroadcasterName string `json:"broadcaster_name"`
// BroadcasterImageURL is the URL to the profile image of the broadcaster that the team belongs to.
BackgroundImageURL string `json:"background_image_url"`
// ThumbnailURL is the URL to the thumbnail of the team.
ThumbnailURL string `json:"thumbnail_url"`
// TeamName is the name of the team.
TeamName string `json:"team_name"`
// TeamDisplayName is the display name of the team.
TeamDisplayName string `json:"team_display_name"`
// Banner is the URL to the banner of the team.
Banner string `json:"banner"`
// Info is the description of the team.
Info string `json:"info"`
// CreatedAt is the UTC timestamp of when the team was created.
CreatedAt time.Time `json:"created_at"`
// UpdatedAt is the UTC timestamp of when the team was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
ChannelTeam represents a Twitch channel team.
type ChannelTeamsListCall ¶ added in v0.4.0
type ChannelTeamsListCall struct {
// contains filtered or unexported fields
}
ChannelTeamsListCall represents a GET call to a Twitch TeamsChannels API endpoint.
func (*ChannelTeamsListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelTeamsListCall) BroadcasterID(broadcasterID string) *ChannelTeamsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelTeamsListCall) Do ¶ added in v0.4.0
func (api *ChannelTeamsListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelTeamsListResponse, error)
Do executes the request.
type ChannelTeamsListResponse ¶ added in v0.4.0
type ChannelTeamsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ChannelTeam data returned by the Twitch API.
Data []ChannelTeam
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelTeamsListResponse represents the response from a GET request to /helix/teams/channel.
type ChannelsEditorsResource ¶ added in v0.4.0
type ChannelsEditorsResource struct {
// contains filtered or unexported fields
}
ChannelsEditorsResource represents the Twitch ChannelsEditors API.
func NewChannelsEditorsResource ¶ added in v0.4.0
func NewChannelsEditorsResource(client *Client) *ChannelsEditorsResource
NewChannelsEditorsResource creates a new ChannelsEditorsResource.
func (*ChannelsEditorsResource) List ¶ added in v0.4.0
func (r *ChannelsEditorsResource) List(broadcasterID string) *ChannelEditorsListCall
List creates a new GET request to /helix/channels/editors.
Gets the list of editors for a broadcaster.
Authorization ¶
Requires a user access token that includes the channel:read:editors scope.
Check the Official Twitch Documentation for more information.
type ChannelsFollowedListCall ¶ added in v0.4.0
type ChannelsFollowedListCall struct {
// contains filtered or unexported fields
}
ChannelsFollowedListCall represents a GET call to a Twitch ChannelsFollowed API endpoint.
func (*ChannelsFollowedListCall) After ¶ added in v0.4.0
func (api *ChannelsFollowedListCall) After(after string) *ChannelsFollowedListCall
After sets the After query parameter.
func (*ChannelsFollowedListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChannelsFollowedListCall) BroadcasterID(broadcasterID string) *ChannelsFollowedListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChannelsFollowedListCall) Do ¶ added in v0.4.0
func (api *ChannelsFollowedListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelsFollowedListResponse, error)
Do executes the request.
func (*ChannelsFollowedListCall) First ¶ added in v0.4.0
func (api *ChannelsFollowedListCall) First(first int) *ChannelsFollowedListCall
First sets the First query parameter.
func (*ChannelsFollowedListCall) UserID ¶ added in v0.4.0
func (api *ChannelsFollowedListCall) UserID(userID string) *ChannelsFollowedListCall
UserID sets the UserID query parameter.
type ChannelsFollowedListResponse ¶ added in v0.4.0
type ChannelsFollowedListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Total is the int data returned by the Twitch API.
Total int
// Data is the Followed data returned by the Twitch API.
Data []Followed
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChannelsFollowedListResponse represents the response from a GET request to /helix/channels/followed.
type ChannelsFollowedResource ¶ added in v0.4.0
type ChannelsFollowedResource struct {
// contains filtered or unexported fields
}
ChannelsFollowedResource represents the Twitch ChannelsFollowed API.
func NewChannelsFollowedResource ¶ added in v0.4.0
func NewChannelsFollowedResource(client *Client) *ChannelsFollowedResource
NewChannelsFollowedResource creates a new ChannelsFollowedResource.
func (*ChannelsFollowedResource) List ¶ added in v0.4.0
func (r *ChannelsFollowedResource) List(userID string) *ChannelsFollowedListCall
List creates a new GET request to /helix/channels/followed.
Gets a list of broadcasters that the specified user follows. You can also use this endpoint to see whether a user follows a specific broadcaster.
Authorization ¶
Requires a user access token that includes the user:read:follows scope.
Check the Official Twitch Documentation for more information.
type ChannelsFollowersResource ¶ added in v0.4.0
type ChannelsFollowersResource struct {
// contains filtered or unexported fields
}
ChannelsFollowersResource represents the Twitch ChannelsFollowers API.
func NewChannelsFollowersResource ¶ added in v0.4.0
func NewChannelsFollowersResource(client *Client) *ChannelsFollowersResource
NewChannelsFollowersResource creates a new ChannelsFollowersResource.
func (*ChannelsFollowersResource) List ¶ added in v0.4.0
func (r *ChannelsFollowersResource) List(broadcasterID string) *ChannelFollowersListCall
List creates a new GET request to /helix/channels/followers.
Gets a list of users that follow the specified broadcaster. You can also use this endpoint to see whether a specific user follows the broadcaster.
Authorization ¶
Requires a user access token that includes the moderator:read:followers scope.
The ID in the broadcaster_id query parameter must match the user ID in the access token or the user ID in the access token must be a moderator for the specified broadcaster.
Check the Official Twitch Documentation for more information.
type ChannelsResource ¶
type ChannelsResource struct {
// Editors provides access to the Twitch Editors API.
Editors *ChannelsEditorsResource
// Followed provides access to the Twitch Followed API.
Followed *ChannelsFollowedResource
// Followers provides access to the Twitch Followers API.
Followers *ChannelsFollowersResource
// contains filtered or unexported fields
}
ChannelsResource represents the Twitch Channels API.
func NewChannelsResource ¶
func NewChannelsResource(client *Client) *ChannelsResource
NewChannelsResource creates a new ChannelsResource.
func (*ChannelsResource) List ¶
func (r *ChannelsResource) List(broadcasterID string) *ChannelInformationListCall
List creates a new GET request to /helix/channels.
Gets information about one or more channels.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
func (*ChannelsResource) Modify ¶ added in v0.4.0
func (r *ChannelsResource) Modify(broadcasterID string) *ChannelInformationModifyCall
Modify creates a new PATCH request to /helix/channels.
Updates properties for a channel.
Authorization ¶
Requires a user access token that includes the channel:manage:broadcast scope.
Check the Official Twitch Documentation for more information.
type CharityCampaign ¶ added in v0.4.0
type CharityCampaign struct {
// ID is the ID that uniquely identifies the charity campaign.
ID string `json:"id"`
// BroadcasterID is the ID of the broadcaster running the charity campaign.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster running the charity campaign.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster running the charity campaign.
BroadcasterName string `json:"broadcaster_name"`
// CharityName is the name of the charity.
CharityName string `json:"charity_name"`
// CharityDescription is the description of the charity.
CharityDescription string `json:"charity_description"`
// CharityLogo is the URL to the logo of the charity.
CharityLogo string `json:"charity_logo"`
// CharityWebsite is the URL to the website of the charity.
CharityWebsite string `json:"charity_website"`
// CurrentAmount is the current amount of money raised by the charity campaign.
CurrentAmount CharityCampaignAmount `json:"current_amount"`
// TargetAmount is the target amount of money to be raised by the charity campaign.
TargetAmount CharityCampaignAmount `json:"target_amount"`
}
CharityCampaign represents a charity campaign on a Twitch channel.
type CharityCampaignAmount ¶ added in v0.4.0
type CharityCampaignAmount struct {
// Value is the amount in the currency's minor unit (e.g., cents for USD).
Value int `json:"value"`
// Decimal is the number of decimal places used by the currency. This number is used to translate value from minor units to major units.
Decimal int `json:"decimal"`
// Currency is the ISO-4217 three-letter currency code that identifies the type of currency (e.g., "USD").
Currency string `json:"currency"`
}
CharityCampaignAmount represents a monetary amount in a specific currency.
func (CharityCampaignAmount) Amount ¶ added in v0.4.0
func (a CharityCampaignAmount) Amount() float64
Amount returns the amount in major currency units.
type CharityCampaignDonation ¶ added in v0.4.0
type CharityCampaignDonation struct {
// ID is the ID that uniquely identifies the charity campaign donation.
ID string `json:"id"`
// CampaignID is the ID of the charity campaign the donation was made to.
CampaignID string `json:"campaign_id"`
// UserID is the ID of the user that made the donation.
UserID string `json:"user_id"`
// UserLogin is the login name of the user that made the donation.
UserLogin string `json:"user_login"`
// UserName is the display name of the user that made the donation.
UserName string `json:"user_name"`
// Amount is the amount of money that was donated.
Amount CharityCampaignAmount `json:"amount"`
}
CharityCampaignDonation represents a donation made to a charity campaign.
type CharityCampaignListCall ¶ added in v0.4.0
type CharityCampaignListCall struct {
// contains filtered or unexported fields
}
CharityCampaignListCall represents a GET call to a Twitch CharityCampaign API endpoint.
func (*CharityCampaignListCall) BroadcasterID ¶ added in v0.4.0
func (api *CharityCampaignListCall) BroadcasterID(broadcasterID string) *CharityCampaignListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*CharityCampaignListCall) Do ¶ added in v0.4.0
func (api *CharityCampaignListCall) Do(ctx context.Context, opts ...RequestOption) (*CharityCampaignListResponse, error)
Do executes the request.
type CharityCampaignListResponse ¶ added in v0.4.0
type CharityCampaignListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the CharityCampaign data returned by the Twitch API.
Data []CharityCampaign
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
CharityCampaignListResponse represents the response from a GET request to /helix/charity/campaigns.
type CharityCampaignResource ¶ added in v0.4.0
type CharityCampaignResource struct {
// contains filtered or unexported fields
}
CharityCampaignResource represents the Twitch CharityCampaign API.
func NewCharityCampaignResource ¶ added in v0.4.0
func NewCharityCampaignResource(client *Client) *CharityCampaignResource
NewCharityCampaignResource creates a new CharityCampaignResource.
func (*CharityCampaignResource) List ¶ added in v0.4.0
func (r *CharityCampaignResource) List(broadcasterID string) *CharityCampaignListCall
List creates a new GET request to /helix/charity/campaigns.
Gets information about the charity campaign that a broadcaster is running. For example, the fundraising goal for a campaign and the current amount of donations.
To receive events when progress is made towards the campaign goal or the broadcaster changes the fundraising goal, subscribe to the channel.charity_campaign.progress subscription type.
Authorization ¶
Requires a user access token that includes the channel:read:charity scope.
Check the Official Twitch Documentation for more information.
type CharityDonationsListCall ¶ added in v0.4.0
type CharityDonationsListCall struct {
// contains filtered or unexported fields
}
CharityDonationsListCall represents a GET call to a Twitch CharityDonations API endpoint.
func (*CharityDonationsListCall) After ¶ added in v0.4.0
func (api *CharityDonationsListCall) After(after string) *CharityDonationsListCall
After sets the After query parameter.
func (*CharityDonationsListCall) BroadcasterID ¶ added in v0.4.0
func (api *CharityDonationsListCall) BroadcasterID(broadcasterID string) *CharityDonationsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*CharityDonationsListCall) Do ¶ added in v0.4.0
func (api *CharityDonationsListCall) Do(ctx context.Context, opts ...RequestOption) (*CharityDonationsListResponse, error)
Do executes the request.
func (*CharityDonationsListCall) First ¶ added in v0.4.0
func (api *CharityDonationsListCall) First(first int) *CharityDonationsListCall
First sets the First query parameter.
type CharityDonationsListResponse ¶ added in v0.4.0
type CharityDonationsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the CharityCampaignDonation data returned by the Twitch API.
Data []CharityCampaignDonation
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
CharityDonationsListResponse represents the response from a GET request to /helix/charity/donations.
type CharityDonationsResource ¶ added in v0.4.0
type CharityDonationsResource struct {
// contains filtered or unexported fields
}
CharityDonationsResource represents the Twitch CharityDonations API.
func NewCharityDonationsResource ¶ added in v0.4.0
func NewCharityDonationsResource(client *Client) *CharityDonationsResource
NewCharityDonationsResource creates a new CharityDonationsResource.
func (*CharityDonationsResource) List ¶ added in v0.4.0
func (r *CharityDonationsResource) List(broadcasterID string) *CharityDonationsListCall
List creates a new GET request to /helix/charity/donations.
Gets the list of donations that users have made to the broadcasters active charity campaign.
To receive events as donations occur, subscribe to the channel.charity_campaign.donate subscription type.
Authorization ¶
Requires a user access token that includes the channel:read:charity scope.
Check the Official Twitch Documentation for more information.
type CharityResource ¶
type CharityResource struct {
// Campaign provides access to the Twitch Campaign API.
Campaign *CharityCampaignResource
// Donations provides access to the Twitch Donations API.
Donations *CharityDonationsResource
// contains filtered or unexported fields
}
CharityResource represents the Twitch Charity API.
func NewCharityResource ¶
func NewCharityResource(client *Client) *CharityResource
NewCharityResource creates a new CharityResource.
type ChatAnnouncementInsertCall ¶ added in v0.4.0
type ChatAnnouncementInsertCall struct {
// contains filtered or unexported fields
}
ChatAnnouncementInsertCall represents a POST call to a Twitch ChatAnnouncement API endpoint.
func (*ChatAnnouncementInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *ChatAnnouncementInsertCall) BroadcasterID(broadcasterID string) *ChatAnnouncementInsertCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChatAnnouncementInsertCall) Color ¶ added in v0.4.0
func (api *ChatAnnouncementInsertCall) Color(color string) *ChatAnnouncementInsertCall
Color sets the Color body parameter.
func (*ChatAnnouncementInsertCall) Do ¶ added in v0.4.0
func (api *ChatAnnouncementInsertCall) Do(ctx context.Context, opts ...RequestOption) (*ChatAnnouncementInsertResponse, error)
Do executes the request.
func (*ChatAnnouncementInsertCall) Message ¶ added in v0.4.0
func (api *ChatAnnouncementInsertCall) Message(message string) *ChatAnnouncementInsertCall
Message sets the Message body parameter.
func (*ChatAnnouncementInsertCall) ModeratorID ¶ added in v0.4.0
func (api *ChatAnnouncementInsertCall) ModeratorID(moderatorID string) *ChatAnnouncementInsertCall
ModeratorID sets the ModeratorID query parameter.
type ChatAnnouncementInsertResponse ¶ added in v0.4.0
type ChatAnnouncementInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChatAnnouncementInsertResponse represents the response from a POST request to /helix/chat/announcements.
type ChatAnnouncementResource ¶ added in v0.4.0
type ChatAnnouncementResource struct {
// contains filtered or unexported fields
}
ChatAnnouncementResource represents the Twitch ChatAnnouncement API.
func NewChatAnnouncementResource ¶ added in v0.4.0
func NewChatAnnouncementResource(client *Client) *ChatAnnouncementResource
NewChatAnnouncementResource creates a new ChatAnnouncementResource.
func (*ChatAnnouncementResource) Insert ¶ added in v0.4.0
func (r *ChatAnnouncementResource) Insert(broadcasterID string, moderatorID string, message string) *ChatAnnouncementInsertCall
Insert creates a new POST request to /helix/chat/announcements.
Sends an announcement to a chat room.
Rate Limits ¶
One announcement may be sent every 2 seconds.
Authorization ¶
Requires a user access token that includes the moderator:manage:announcements scope.
Check the Official Twitch Documentation for more information.
type ChatBadge ¶ added in v0.4.0
type ChatBadge struct {
// SetID is the ID of the badge set the badge belongs to.
SetID string `json:"set_id"`
// Versions is a list of versions of the badge.
Versions []ChatBadgeVersion `json:"versions"`
}
ChatBadge represents a Twitch chat badge.
type ChatBadgeVersion ¶ added in v0.4.0
type ChatBadgeVersion struct {
// ID is the ID of the badge version.
ID string `json:"id"`
// ImageSize1X is the URL to the 1x size image of the badge.
ImageSize1X string `json:"image_url_1x"`
// ImageSize2X is the URL to the 2x size image of the badge.
ImageSize2X string `json:"image_url_2x"`
// ImageSize4X is the URL to the 4x size image of the badge.
ImageSize4X string `json:"image_url_4x"`
// Description is the description of the badge.
Description string `json:"description"`
// Title is the title of the badge.
Title string `json:"title"`
// ClickAction is the click action of the badge.
ClickAction string `json:"click_action"`
// ClickURL is the URL to open when the badge is clicked.
ClickURL string `json:"click_url"`
}
ChatBadgeVersion represents a version of a Twitch chat badge.
type ChatBadgesGlobalResource ¶ added in v0.4.0
type ChatBadgesGlobalResource struct {
// contains filtered or unexported fields
}
ChatBadgesGlobalResource represents the Twitch ChatBadgesGlobal API.
func NewChatBadgesGlobalResource ¶ added in v0.4.0
func NewChatBadgesGlobalResource(client *Client) *ChatBadgesGlobalResource
NewChatBadgesGlobalResource creates a new ChatBadgesGlobalResource.
func (*ChatBadgesGlobalResource) List ¶ added in v0.4.0
func (r *ChatBadgesGlobalResource) List() *GlobalChatBadgesListCall
List creates a new GET request to /helix/chat/badges/global.
Gets list of chat badges on Twitch, which users may use in any chat room.
Check the Official Twitch Documentation for more information.
type ChatBadgesResource ¶ added in v0.4.0
type ChatBadgesResource struct {
// Global provides access to the Twitch Global API.
Global *ChatBadgesGlobalResource
// contains filtered or unexported fields
}
ChatBadgesResource represents the Twitch ChatBadges API.
func NewChatBadgesResource ¶ added in v0.4.0
func NewChatBadgesResource(client *Client) *ChatBadgesResource
NewChatBadgesResource creates a new ChatBadgesResource.
func (*ChatBadgesResource) List ¶ added in v0.4.0
func (r *ChatBadgesResource) List(broadcasterID string) *ChannelChatBadgesListCall
List creates a new GET request to /helix/chat/badges.
Gets the list of custom chat badges for a broadcaster.
The list is empty if the broadcaster hasnt created custom chat badges.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type ChatChattersListCall ¶ added in v0.4.0
type ChatChattersListCall struct {
// contains filtered or unexported fields
}
ChatChattersListCall represents a GET call to a Twitch ChatChatters API endpoint.
func (*ChatChattersListCall) After ¶ added in v0.4.0
func (api *ChatChattersListCall) After(after string) *ChatChattersListCall
After sets the After query parameter.
func (*ChatChattersListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChatChattersListCall) BroadcasterID(broadcasterID string) *ChatChattersListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChatChattersListCall) Do ¶ added in v0.4.0
func (api *ChatChattersListCall) Do(ctx context.Context, opts ...RequestOption) (*ChatChattersListResponse, error)
Do executes the request.
func (*ChatChattersListCall) First ¶ added in v0.4.0
func (api *ChatChattersListCall) First(first int) *ChatChattersListCall
First sets the First query parameter.
func (*ChatChattersListCall) ModeratorID ¶ added in v0.4.0
func (api *ChatChattersListCall) ModeratorID(moderatorID string) *ChatChattersListCall
ModeratorID sets the ModeratorID query parameter.
type ChatChattersListResponse ¶ added in v0.4.0
type ChatChattersListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Total is the int data returned by the Twitch API.
Total int
// Data is the UserInfo data returned by the Twitch API.
Data []UserInfo
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChatChattersListResponse represents the response from a GET request to /helix/chat/chatters.
type ChatChattersResource ¶ added in v0.4.0
type ChatChattersResource struct {
// User provides access to the Twitch User API.
User *ChatChattersUserResource
// contains filtered or unexported fields
}
ChatChattersResource represents the Twitch ChatChatters API.
func NewChatChattersResource ¶ added in v0.4.0
func NewChatChattersResource(client *Client) *ChatChattersResource
NewChatChattersResource creates a new ChatChattersResource.
func (*ChatChattersResource) List ¶ added in v0.4.0
func (r *ChatChattersResource) List(broadcasterID string, moderatorID string) *ChatChattersListCall
List creates a new GET request to /helix/chat/chatters.
Gets the list of users that are connected to a chat session.
To determine whether a user is a moderator or VIP, use the Get Moderators and Get VIPs endpoints. You can check the roles of up to 100 users.
Authorization ¶
Requires a user access token that includes the moderator:read:chatters scope.
Check the Official Twitch Documentation for more information.
type ChatChattersUserColorResource ¶ added in v0.4.0
type ChatChattersUserColorResource struct {
// contains filtered or unexported fields
}
ChatChattersUserColorResource represents the Twitch ChatChattersUserColor API.
func NewChatChattersUserColorResource ¶ added in v0.4.0
func NewChatChattersUserColorResource(client *Client) *ChatChattersUserColorResource
NewChatChattersUserColorResource creates a new ChatChattersUserColorResource.
func (*ChatChattersUserColorResource) List ¶ added in v0.4.0
func (r *ChatChattersUserColorResource) List(userID string) *UserChatColorListCall
List creates a new GET request to /helix/chat/color.
Gets the chat color for a user.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
func (*ChatChattersUserColorResource) Update ¶ added in v0.4.0
func (r *ChatChattersUserColorResource) Update(userID string, color string) *UserChatColorUpdateCall
Update creates a new PUT request to /helix/chat/color.
Updates the display color for the user in chat.
Authorization ¶
Requires a user access token that includes the user:manage:chat_color scope.
Check the Official Twitch Documentation for more information.
type ChatChattersUserResource ¶ added in v0.4.0
type ChatChattersUserResource struct {
// Color provides access to the Twitch Color API.
Color *ChatChattersUserColorResource
// contains filtered or unexported fields
}
ChatChattersUserResource represents the Twitch ChatChattersUser API.
func NewChatChattersUserResource ¶ added in v0.4.0
func NewChatChattersUserResource(client *Client) *ChatChattersUserResource
NewChatChattersUserResource creates a new ChatChattersUserResource.
type ChatEmoteSetsResource ¶ added in v0.4.0
type ChatEmoteSetsResource struct {
// contains filtered or unexported fields
}
ChatEmoteSetsResource represents the Twitch ChatEmoteSets API.
func NewChatEmoteSetsResource ¶ added in v0.4.0
func NewChatEmoteSetsResource(client *Client) *ChatEmoteSetsResource
NewChatEmoteSetsResource creates a new ChatEmoteSetsResource.
func (*ChatEmoteSetsResource) List ¶ added in v0.4.0
func (r *ChatEmoteSetsResource) List(emoteSetID string) *EmoteSetsListCall
List creates a new GET request to /helix/chat/emotes/set.
Gets emotes for one or more specified emote sets.
An emote set groups emotes that have a similar context. For example, Twitch places all the subscriber emotes that a broadcaster uploads for their channel in the same emote set.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type ChatEmotesChannelResource ¶ added in v0.4.0
type ChatEmotesChannelResource struct {
// contains filtered or unexported fields
}
ChatEmotesChannelResource represents the Twitch ChatEmotesChannel API.
func NewChatEmotesChannelResource ¶ added in v0.4.0
func NewChatEmotesChannelResource(client *Client) *ChatEmotesChannelResource
NewChatEmotesChannelResource creates a new ChatEmotesChannelResource.
func (*ChatEmotesChannelResource) List ¶ added in v0.4.0
func (r *ChatEmotesChannelResource) List(broadcasterID string) *ChannelEmotesListCall
List creates a new GET request to /helix/chat/emotes.
Gets the list of custom emotes for a broadcaster. Broadcasters create these custom emotes for users who subscribe to or follow the channel or cheer Bits in the chat window.
With the exception of custom follower emotes, users may use custom emotes in any Twitch chat.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type ChatEmotesGlobalResource ¶ added in v0.4.0
type ChatEmotesGlobalResource struct {
// contains filtered or unexported fields
}
ChatEmotesGlobalResource represents the Twitch ChatEmotesGlobal API.
func NewChatEmotesGlobalResource ¶ added in v0.4.0
func NewChatEmotesGlobalResource(client *Client) *ChatEmotesGlobalResource
NewChatEmotesGlobalResource creates a new ChatEmotesGlobalResource.
func (*ChatEmotesGlobalResource) List ¶ added in v0.4.0
func (r *ChatEmotesGlobalResource) List() *GlobalEmotesListCall
List creates a new GET request to /helix/chat/emotes/global.
Gets the list of global emotes. Global emotes are Twitch-created emotes that users can use in any Twitch chat.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type ChatEmotesResource ¶ added in v0.4.0
type ChatEmotesResource struct {
// Channel provides access to the Twitch Channel API.
Channel *ChatEmotesChannelResource
// Global provides access to the Twitch Global API.
Global *ChatEmotesGlobalResource
// User provides access to the Twitch User API.
User *ChatEmotesUserResource
// contains filtered or unexported fields
}
ChatEmotesResource represents the Twitch ChatEmotes API.
func NewChatEmotesResource ¶ added in v0.4.0
func NewChatEmotesResource(client *Client) *ChatEmotesResource
NewChatEmotesResource creates a new ChatEmotesResource.
type ChatEmotesUserResource ¶ added in v0.4.0
type ChatEmotesUserResource struct {
// contains filtered or unexported fields
}
ChatEmotesUserResource represents the Twitch ChatEmotesUser API.
func NewChatEmotesUserResource ¶ added in v0.4.0
func NewChatEmotesUserResource(client *Client) *ChatEmotesUserResource
NewChatEmotesUserResource creates a new ChatEmotesUserResource.
func (*ChatEmotesUserResource) List ¶ added in v0.4.0
func (r *ChatEmotesUserResource) List(userID string) *UserEmotesListCall
List creates a new GET request to /helix/chat/emotes/user.
Retrieves emotes available to the user across all channels.
Authorization ¶
Requires a user access token that includes the user:read:emotes scope.
Query parameter user_id must match the user_id in the user access token.
Check the Official Twitch Documentation for more information.
type ChatMessagesDeleteCall ¶ added in v0.4.0
type ChatMessagesDeleteCall struct {
// contains filtered or unexported fields
}
ChatMessagesDeleteCall represents a DELETE call to a Twitch ModerationClearChat API endpoint.
func (*ChatMessagesDeleteCall) BroadcasterID ¶ added in v0.4.0
func (api *ChatMessagesDeleteCall) BroadcasterID(broadcasterID string) *ChatMessagesDeleteCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChatMessagesDeleteCall) Do ¶ added in v0.4.0
func (api *ChatMessagesDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*ChatMessagesDeleteResponse, error)
Do executes the request.
func (*ChatMessagesDeleteCall) MessageID ¶ added in v0.4.0
func (api *ChatMessagesDeleteCall) MessageID(messageID string) *ChatMessagesDeleteCall
MessageID sets the MessageID query parameter.
func (*ChatMessagesDeleteCall) ModeratorID ¶ added in v0.4.0
func (api *ChatMessagesDeleteCall) ModeratorID(moderatorID string) *ChatMessagesDeleteCall
ModeratorID sets the ModeratorID query parameter.
type ChatMessagesDeleteResponse ¶ added in v0.4.0
type ChatMessagesDeleteResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChatMessagesDeleteResponse represents the response from a DELETE request to /helix/moderation/chat.
type ChatResource ¶
type ChatResource struct {
// Badges provides access to the Twitch Badges API.
Badges *ChatBadgesResource
// Chatters provides access to the Twitch Chatters API.
Chatters *ChatChattersResource
// Emotes provides access to the Twitch Emotes API.
Emotes *ChatEmotesResource
// EmoteSets provides access to the Twitch EmoteSets API.
EmoteSets *ChatEmoteSetsResource
// Settings provides access to the Twitch Settings API.
Settings *ChatSettingsResource
Shared *ChatSharedResource
// Announcement provides access to the Twitch Announcement API.
Announcement *ChatAnnouncementResource
// Shoutout provides access to the Twitch Shoutout API.
Shoutout *ChatShoutoutResource
// contains filtered or unexported fields
}
ChatResource represents the Twitch Chat API.
func NewChatResource ¶
func NewChatResource(client *Client) *ChatResource
NewChatResource creates a new ChatResource.
func (*ChatResource) Insert ¶ added in v0.4.0
func (r *ChatResource) Insert(broadcasterID string, senderID string, message string) *SendMessageInsertCall
Insert creates a new POST request to /helix/chat/messages.
Sends a message to the specified chat room.
Rate Limits ¶
A user may send 20 messages every 30 seconds per channel.
Authorization ¶
Requires an app access token or user access token that includes the user:write:chat scope.
If app access token used, then additionally requires user:bot scope from chatting user, and either channel:bot scope from broadcaster or moderator status.
Check the Official Twitch Documentation for more information.
type ChatSettings ¶ added in v0.4.0
type ChatSettings struct {
// BroadcasterID is the ID of the broadcaster whose chat settings are being managed.
BroadcasterID string `json:"broadcaster_id"`
// EmoteMode indicates whether emote-only mode is enabled.
EmoteMode bool `json:"emote_mode"`
// FollowMode indicates whether follow-only mode is enabled.
FollowMode bool `json:"follow_mode"`
// FollowModeDurationMinutes is the duration in minutes that a user must follow the channel before they can chat.
FollowModeDurationMinutes int `json:"follow_mode_duration"`
// NonModeratorChatDelay indicates whether non-moderator chat delay is enabled.
NonModeratorChatDelay bool `json:"non_moderator_chat_delay"`
// NonModeratorChatDelaySeconds is the duration in seconds of the non-moderator chat delay.
NonModeratorChatDelaySeconds int `json:"non_moderator_chat_delay_duration"`
// SlowMode indicates whether slow mode is enabled.
SlowMode bool `json:"slow_mode"`
// SlowModeWaitTimeSeconds is the duration in seconds that a user must wait between sending messages in slow mode.
SlowModeWaitTimeSeconds int `json:"slow_mode_wait_time"`
// SubscriberMode indicates whether subscriber-only mode is enabled.
SubscriberMode bool `json:"subscriber_mode"`
// UniqueChatMode indicates whether unique chat mode is enabled.
UniqueChatMode bool `json:"unique_chat_mode"`
}
ChatSettings represents the chat settings for a Twitch channel.
type ChatSettingsListCall ¶ added in v0.4.0
type ChatSettingsListCall struct {
// contains filtered or unexported fields
}
ChatSettingsListCall represents a GET call to a Twitch ChatSettings API endpoint.
func (*ChatSettingsListCall) BroadcasterID ¶ added in v0.4.0
func (api *ChatSettingsListCall) BroadcasterID(broadcasterID string) *ChatSettingsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChatSettingsListCall) Do ¶ added in v0.4.0
func (api *ChatSettingsListCall) Do(ctx context.Context, opts ...RequestOption) (*ChatSettingsListResponse, error)
Do executes the request.
func (*ChatSettingsListCall) ModeratorID ¶ added in v0.4.0
func (api *ChatSettingsListCall) ModeratorID(moderatorID string) *ChatSettingsListCall
ModeratorID sets the ModeratorID query parameter.
type ChatSettingsListResponse ¶ added in v0.4.0
type ChatSettingsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ChatSettings data returned by the Twitch API.
Data []ChatSettings
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChatSettingsListResponse represents the response from a GET request to /helix/chat/settings.
type ChatSettingsModifyCall ¶ added in v0.4.0
type ChatSettingsModifyCall struct {
// contains filtered or unexported fields
}
ChatSettingsModifyCall represents a PATCH call to a Twitch ChatSettings API endpoint.
func (*ChatSettingsModifyCall) BroadcasterID ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) BroadcasterID(broadcasterID string) *ChatSettingsModifyCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ChatSettingsModifyCall) Do ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ChatSettingsModifyResponse, error)
Do executes the request.
func (*ChatSettingsModifyCall) EmoteMode ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) EmoteMode(emoteMode bool) *ChatSettingsModifyCall
EmoteMode sets the EmoteMode body parameter.
func (*ChatSettingsModifyCall) FollowerMode ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) FollowerMode(followerMode bool) *ChatSettingsModifyCall
FollowerMode sets the FollowerMode body parameter.
func (*ChatSettingsModifyCall) FollowerModeDuration ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) FollowerModeDuration(followerModeDuration int) *ChatSettingsModifyCall
FollowerModeDuration sets the FollowerModeDuration body parameter.
func (*ChatSettingsModifyCall) ModeratorID ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) ModeratorID(moderatorID string) *ChatSettingsModifyCall
ModeratorID sets the ModeratorID query parameter.
func (*ChatSettingsModifyCall) NonModeratorChatDelay ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) NonModeratorChatDelay(nonModeratorChatDelay bool) *ChatSettingsModifyCall
NonModeratorChatDelay sets the NonModeratorChatDelay body parameter.
func (*ChatSettingsModifyCall) NonModeratorChatDelayDuration ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) NonModeratorChatDelayDuration(nonModeratorChatDelayDuration int) *ChatSettingsModifyCall
NonModeratorChatDelayDuration sets the NonModeratorChatDelayDuration body parameter.
func (*ChatSettingsModifyCall) SlowMode ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) SlowMode(slowMode bool) *ChatSettingsModifyCall
SlowMode sets the SlowMode body parameter.
func (*ChatSettingsModifyCall) SlowModeWaitTime ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) SlowModeWaitTime(slowModeWaitTime int) *ChatSettingsModifyCall
SlowModeWaitTime sets the SlowModeWaitTime body parameter.
func (*ChatSettingsModifyCall) SubscriberMode ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) SubscriberMode(subscriberMode bool) *ChatSettingsModifyCall
SubscriberMode sets the SubscriberMode body parameter.
func (*ChatSettingsModifyCall) UniqueChatMode ¶ added in v0.4.0
func (api *ChatSettingsModifyCall) UniqueChatMode(uniqueChatMode bool) *ChatSettingsModifyCall
UniqueChatMode sets the UniqueChatMode body parameter.
type ChatSettingsModifyResponse ¶ added in v0.4.0
type ChatSettingsModifyResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ChatSettings data returned by the Twitch API.
Data []ChatSettings
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChatSettingsModifyResponse represents the response from a PATCH request to /helix/chat/settings.
type ChatSettingsResource ¶ added in v0.4.0
type ChatSettingsResource struct {
// contains filtered or unexported fields
}
ChatSettingsResource represents the Twitch ChatSettings API.
func NewChatSettingsResource ¶ added in v0.4.0
func NewChatSettingsResource(client *Client) *ChatSettingsResource
NewChatSettingsResource creates a new ChatSettingsResource.
func (*ChatSettingsResource) List ¶ added in v0.4.0
func (r *ChatSettingsResource) List(broadcasterID string, moderatorID string) *ChatSettingsListCall
List creates a new GET request to /helix/chat/settings.
Gets the chat settings for a channel.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
func (*ChatSettingsResource) Modify ¶ added in v0.4.0
func (r *ChatSettingsResource) Modify(broadcasterID string, moderatorID string) *ChatSettingsModifyCall
Modify creates a new PATCH request to /helix/chat/settings.
Updates the chat settings for a channel.
Authorization ¶
Requires a user access token that includes the moderator:manage:chat_settings scope.
Check the Official Twitch Documentation for more information.
type ChatSharedResource ¶ added in v0.4.0
type ChatSharedResource struct {
// contains filtered or unexported fields
}
ChatSharedResource represents the Twitch ChatShared API.
func NewChatSharedResource ¶ added in v0.4.0
func NewChatSharedResource(client *Client) *ChatSharedResource
NewChatSharedResource creates a new ChatSharedResource.
func (*ChatSharedResource) List ¶ added in v0.4.0
func (r *ChatSharedResource) List(broadcasterID string) *SharedChatSessionListCall
List creates a new GET request to /helix/shared_chat/session.
Retrieves the active shared chat session for a channel.
Authorization ¶
Requires a user access token that includes the moderator:read:chat_settings scope.
Check the Official Twitch Documentation for more information.
type ChatShoutoutInsertCall ¶ added in v0.4.0
type ChatShoutoutInsertCall struct {
// contains filtered or unexported fields
}
ChatShoutoutInsertCall represents a POST call to a Twitch ChatShoutout API endpoint.
func (*ChatShoutoutInsertCall) Do ¶ added in v0.4.0
func (api *ChatShoutoutInsertCall) Do(ctx context.Context, opts ...RequestOption) (*ChatShoutoutInsertResponse, error)
Do executes the request.
func (*ChatShoutoutInsertCall) FromBroadcasterID ¶ added in v0.4.0
func (api *ChatShoutoutInsertCall) FromBroadcasterID(fromBroadcasterID string) *ChatShoutoutInsertCall
FromBroadcasterID sets the FromBroadcasterID query parameter.
func (*ChatShoutoutInsertCall) ModeratorID ¶ added in v0.4.0
func (api *ChatShoutoutInsertCall) ModeratorID(moderatorID string) *ChatShoutoutInsertCall
ModeratorID sets the ModeratorID query parameter.
func (*ChatShoutoutInsertCall) ToBroadcasterID ¶ added in v0.4.0
func (api *ChatShoutoutInsertCall) ToBroadcasterID(toBroadcasterID string) *ChatShoutoutInsertCall
ToBroadcasterID sets the ToBroadcasterID query parameter.
type ChatShoutoutInsertResponse ¶ added in v0.4.0
type ChatShoutoutInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ChatShoutoutInsertResponse represents the response from a POST request to /helix/chat/shoutouts.
type ChatShoutoutResource ¶ added in v0.4.0
type ChatShoutoutResource struct {
// contains filtered or unexported fields
}
ChatShoutoutResource represents the Twitch ChatShoutout API.
func NewChatShoutoutResource ¶ added in v0.4.0
func NewChatShoutoutResource(client *Client) *ChatShoutoutResource
NewChatShoutoutResource creates a new ChatShoutoutResource.
func (*ChatShoutoutResource) Insert ¶ added in v0.4.0
func (r *ChatShoutoutResource) Insert(fromBroadcasterID string, toBroadcasterID string, moderatorID string) *ChatShoutoutInsertCall
Insert creates a new POST request to /helix/chat/shoutouts.
Sends a shoutout in chat to another channel.
Rate Limits ¶
The broadcaster may send a Shoutout once every 2 minutes.
They may send the same broadcaster a Shoutout once every 60 minutes.
Authorization ¶
Requires a user access token that includes the moderator:manage:shoutouts scope.
Check the Official Twitch Documentation for more information.
type Cheermote ¶
type Cheermote struct {
// Prefix is the prefix of the cheermote.
Prefix string `json:"prefix"`
// Tiers is the list of tiers for the cheermote.
Tiers []CheermoteTier `json:"tiers"`
// Type is the type of the cheermote.
Type string `json:"type"`
// Order is the order of the cheermote in the bits card.
Order int `json:"order"`
// IsCharitable indicates whether the cheermote provides a charitable contribution match during charity campaigns.
IsCharitable bool `json:"is_charitable"`
// LastUpdated is the last time the cheermote was updated.
LastUpdated time.Time `json:"last_updated"`
}
Cheermote represents a Twitch cheermote.
type CheermoteTier ¶
type CheermoteTier struct {
// ID is the tier for the cheermote.
ID string `json:"id"`
// MinBits is the minimum number of bits needed to use the cheermote.
MinBits int `json:"min_bits"`
// Color is the color associated with this tier.
Color string `json:"color"`
// Images is a map of image URLs for the cheermote in different sizes.
Images map[string]string `json:"images"`
// CanCheer indicates whether the cheermote can be used to cheer.
CanCheer bool `json:"can_cheer"`
// ShowInBitsCard indicates whether the cheermote is shown in the bits card.
ShowInBitsCard bool `json:"show_in_bits_card"`
}
CheermoteTier represents a tier of a Twitch cheermote.
type Client ¶
type Client struct {
Ads *AdsResource
Analytics *AnalyticsResource
Bits *BitsResource
ChannelPoints *ChannelPointsResource
Channels *ChannelsResource
Charity *CharityResource
Chat *ChatResource
Clips *ClipsResource
Conduits *ConduitsResource
ContentLabels *ContentLabelsResource
Entitlements *EntitlementsResource
EventSub *EventSubResource
Extensions *ExtensionsResource
Games *GamesResource
Goals *GoalsResource
GuestStar *GuestStarResource
HypeTrain *HypeTrainResource
Moderation *ModerationResource
Polls *PollsResource
Predictions *PredictionsResource
Raids *RaidsResource
Schedule *ScheduleResource
Search *SearchResource
Streams *StreamsResource
Subscriptions *SubscriptionsResource
Teams *TeamsResource
Users *UsersResource
Videos *VideosResource
Whispers *WhispersResource
// contains filtered or unexported fields
}
Client is a client for interacting with the Twitch API.
func New ¶
func New(clientID string, opts ...ClientOption) *Client
New creates a new API client for Twitch.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a function that modifies a Client.
func WithDefaultAuthorization ¶ added in v0.4.2
func WithDefaultAuthorization(authorization Authorization) ClientOption
WithDefaultAuthorization sets the default authorization to use for API requests, usually an App Access Token.
func WithDefaultBearerToken ¶
func WithDefaultBearerToken(token string) ClientOption
WithDefaultBearerToken sets the bearer token to use for API requests.
This can be considered dangerous as if a token is not provided per request, this will become the default token. Some developers may prefer to default to the App Access Token using this method. However, it is recommended to still use the WithBearerToken option for requests that require a token as this method always will fail if the App Access Token has expired.
func WithHTTPClient ¶
func WithHTTPClient(client HTTPClient) ClientOption
WithHTTPClient sets the HTTP client to use for API requests.
type Clip ¶
type Clip struct {
// ID is the ID that uniquely identifies the clip.
ID string `json:"id"`
// CreatorID is the ID of the user who created the clip.
CreatorID string `json:"creator_id"`
// CreatorName is the display name of the user who created the clip.
CreatorName string `json:"creator_name"`
// BroadcasterID is the ID of the broadcaster on whose channel the clip was created.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterName is the display name of the broadcaster on whose channel the clip was created.
BroadcasterName string `json:"broadcaster_name"`
// VideoID is the ID of the video from which the clip was created.
VideoID string `json:"video_id"`
// GameID is the ID of the game being played on the channel when the clip was created.
GameID string `json:"game_id"`
// Language is the language of the channel when the clip was created.
Language string `json:"language"`
// Title is the title of the clip.
Title string `json:"title"`
// URL is the URL of the clip.
URL string `json:"url"`
// EmbedURL is the URL that can be used to embed the clip.
EmbedURL string `json:"embed_url"`
// ThumbnailURL is the URL of the clip's thumbnail image.
ThumbnailURL string `json:"thumbnail_url"`
// VODOffset is the offset in seconds from the start of the VOD where the clip was created.
VODOffset int `json:"vod_offset"`
// ViewCount is the number of times the clip has been viewed.
ViewCount int `json:"view_count"`
// Duration is the duration of the clip. Value has 0.1 second precision.
Duration float64 `json:"duration"`
// CreatedAt is the UTC timestamp of when the clip was created.
Featured bool `json:"featured"`
// CreatedAt is the UTC timestamp of when the clip was created.
CreatedAt time.Time `json:"created_at"`
}
Clip represents a Twitch clip.
type ClipsDownloadListCall ¶ added in v0.4.0
type ClipsDownloadListCall struct {
// contains filtered or unexported fields
}
ClipsDownloadListCall represents a GET call to a Twitch ClipsDownload API endpoint.
func (*ClipsDownloadListCall) BroadcasterID ¶ added in v0.4.0
func (api *ClipsDownloadListCall) BroadcasterID(broadcasterID string) *ClipsDownloadListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ClipsDownloadListCall) ClipID ¶ added in v0.4.0
func (api *ClipsDownloadListCall) ClipID(clipID string) *ClipsDownloadListCall
ClipID sets the ClipID query parameter.
func (*ClipsDownloadListCall) Do ¶ added in v0.4.0
func (api *ClipsDownloadListCall) Do(ctx context.Context, opts ...RequestOption) (*ClipsDownloadListResponse, error)
Do executes the request.
func (*ClipsDownloadListCall) EditorID ¶ added in v0.4.0
func (api *ClipsDownloadListCall) EditorID(editorID string) *ClipsDownloadListCall
EditorID sets the EditorID query parameter.
type ClipsDownloadListResponse ¶ added in v0.4.0
type ClipsDownloadListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the DownloadableClip data returned by the Twitch API.
Data []DownloadableClip
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ClipsDownloadListResponse represents the response from a GET request to /helix/clips/downloads.
type ClipsDownloadResource ¶ added in v0.4.0
type ClipsDownloadResource struct {
// contains filtered or unexported fields
}
ClipsDownloadResource represents the Twitch ClipsDownload API.
func NewClipsDownloadResource ¶ added in v0.4.0
func NewClipsDownloadResource(client *Client) *ClipsDownloadResource
NewClipsDownloadResource creates a new ClipsDownloadResource.
func (*ClipsDownloadResource) List ¶ added in v0.4.0
func (r *ClipsDownloadResource) List() *ClipsDownloadListCall
List creates a new GET request to /helix/clips/downloads.
Provides URLs to download the video file for the specified clips.
Rate Limits ¶
Limited to 100 requests per minute.
Authorization ¶
Requires an app access token or user access token that includes the editor:manage:clips or channel:manage:clips scope.
Check the Official Twitch Documentation for more information.
type ClipsListCall ¶
type ClipsListCall struct {
// contains filtered or unexported fields
}
ClipsListCall represents a GET call to a Twitch Clips API endpoint.
func (*ClipsListCall) After ¶
func (api *ClipsListCall) After(after string) *ClipsListCall
After sets the After query parameter.
func (*ClipsListCall) Before ¶
func (api *ClipsListCall) Before(before string) *ClipsListCall
Before sets the Before query parameter.
func (*ClipsListCall) BroadcasterID ¶
func (api *ClipsListCall) BroadcasterID(broadcasterID string) *ClipsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*ClipsListCall) Do ¶
func (api *ClipsListCall) Do(ctx context.Context, opts ...RequestOption) (*ClipsListResponse, error)
Do executes the request.
func (*ClipsListCall) EndedAt ¶
func (api *ClipsListCall) EndedAt(endedAt time.Time) *ClipsListCall
EndedAt sets the EndedAt query parameter.
func (*ClipsListCall) First ¶
func (api *ClipsListCall) First(first int) *ClipsListCall
First sets the First query parameter.
func (*ClipsListCall) GameID ¶
func (api *ClipsListCall) GameID(gameID string) *ClipsListCall
GameID sets the GameID query parameter.
func (*ClipsListCall) ID ¶
func (api *ClipsListCall) ID(ids ...string) *ClipsListCall
ID adds to the ID query parameter.
func (*ClipsListCall) IsFeatured ¶ added in v0.4.0
func (api *ClipsListCall) IsFeatured(isFeatured bool) *ClipsListCall
IsFeatured sets the IsFeatured query parameter.
func (*ClipsListCall) StartedAt ¶
func (api *ClipsListCall) StartedAt(startedAt time.Time) *ClipsListCall
StartedAt sets the StartedAt query parameter.
type ClipsListResponse ¶
type ClipsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Clip data returned by the Twitch API.
Data []Clip
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ClipsListResponse represents the response from a GET request to /helix/clips.
type ClipsResource ¶
type ClipsResource struct {
// Download provides access to the Twitch Download API.
Download *ClipsDownloadResource
// contains filtered or unexported fields
}
ClipsResource represents the Twitch Clips API.
func NewClipsResource ¶
func NewClipsResource(client *Client) *ClipsResource
NewClipsResource creates a new ClipsResource.
func (*ClipsResource) Insert ¶ added in v0.4.0
func (r *ClipsResource) Insert(broadcasterID string) *CreateClipInsertCall
Insert creates a new POST request to /helix/clips.
Creates a clip for a stream.
Authorization ¶
Requires a user access token that includes the clips:edit scope.
Check the Official Twitch Documentation for more information.
func (*ClipsResource) List ¶
func (r *ClipsResource) List() *ClipsListCall
List creates a new GET request to /helix/clips.
Gets one or more video clips that were captured from streams.
At least one of ID, GameID, and BroadcasterID are required. They are mutually exclusive.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type Commercial ¶
type Commercial struct {
// Length is the duration of the commercial in seconds.
Length int `json:"length"`
// Message is a message which indicates whether Twitch was able to serve an ad.
Message string `json:"message"`
// RetryAfter is the number of seconds the client should wait before trying to start another commercial.
RetryAfter int `json:"retry_after"`
}
Commercial represents a commercial that was started.
type Conduit ¶
type Conduit struct {
// ID is the ID of the conduit.
ID string `json:"id"`
// ShardCount is the number of shards associated with the conduit.
ShardCount int `json:"shard_count"`
}
Conduit represents a Twitch Eventsub Conduit.
type ConduitError ¶ added in v0.4.0
type ConduitError struct {
// ShardID is the ID of the shard the error is for.
ShardID string `json:"id,omitempty"`
// Code is used to represent a specific error condition while attempting to update shards.
Code string `json:"code,omitempty"`
// Message is a human-readable description of the error condition.
Message string `json:"message,omitempty"`
}
ConduitError represents an error returned by an EventSub Conduits API endpoint.
func (ConduitError) Error ¶ added in v0.4.0
func (e ConduitError) Error() string
type ConduitShard ¶
type ConduitShard struct {
// ID is the ID of the conduit shard.
ID string `json:"id"`
// Status is the current status of the conduit shard.
Status string `json:"status,omitempty"`
// Transport is the transport method for the conduit shard.
Transport Transport `json:"transport"`
}
ConduitShard is a shard for a Twitch Eventsub Conduit.
type ConduitsDeleteCall ¶ added in v0.4.0
type ConduitsDeleteCall struct {
// contains filtered or unexported fields
}
ConduitsDeleteCall represents a DELETE call to a Twitch Conduits API endpoint.
func (*ConduitsDeleteCall) Do ¶ added in v0.4.0
func (api *ConduitsDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsDeleteResponse, error)
Do executes the request.
func (*ConduitsDeleteCall) ID ¶ added in v0.4.0
func (api *ConduitsDeleteCall) ID(id string) *ConduitsDeleteCall
ID sets the ID query parameter.
type ConduitsDeleteResponse ¶ added in v0.4.0
type ConduitsDeleteResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ConduitsDeleteResponse represents the response from a DELETE request to /helix/eventsub/conduits.
type ConduitsInsertCall ¶ added in v0.4.0
type ConduitsInsertCall struct {
// contains filtered or unexported fields
}
ConduitsInsertCall represents a POST call to a Twitch Conduits API endpoint.
func (*ConduitsInsertCall) Do ¶ added in v0.4.0
func (api *ConduitsInsertCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsInsertResponse, error)
Do executes the request.
func (*ConduitsInsertCall) ShardCount ¶ added in v0.4.0
func (api *ConduitsInsertCall) ShardCount(shardCount int) *ConduitsInsertCall
ShardCount sets the ShardCount body parameter.
type ConduitsInsertResponse ¶ added in v0.4.0
type ConduitsInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Conduit data returned by the Twitch API.
Data []Conduit
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ConduitsInsertResponse represents the response from a POST request to /helix/eventsub/conduits.
type ConduitsListCall ¶
type ConduitsListCall struct {
// contains filtered or unexported fields
}
ConduitsListCall represents a GET call to a Twitch Conduits API endpoint.
func (*ConduitsListCall) Do ¶
func (api *ConduitsListCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsListResponse, error)
Do executes the request.
type ConduitsListResponse ¶ added in v0.4.0
type ConduitsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Conduit data returned by the Twitch API.
Data []Conduit
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ConduitsListResponse represents the response from a GET request to /helix/eventsub/conduits.
type ConduitsModifyCall ¶ added in v0.4.0
type ConduitsModifyCall struct {
// contains filtered or unexported fields
}
ConduitsModifyCall represents a PATCH call to a Twitch Conduits API endpoint.
func (*ConduitsModifyCall) Do ¶ added in v0.4.0
func (api *ConduitsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsModifyResponse, error)
Do executes the request.
func (*ConduitsModifyCall) ID ¶ added in v0.4.0
func (api *ConduitsModifyCall) ID(id string) *ConduitsModifyCall
ID sets the ID body parameter.
func (*ConduitsModifyCall) ShardCount ¶ added in v0.4.0
func (api *ConduitsModifyCall) ShardCount(shardCount int) *ConduitsModifyCall
ShardCount sets the ShardCount body parameter.
type ConduitsModifyResponse ¶ added in v0.4.0
type ConduitsModifyResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Conduit data returned by the Twitch API.
Data []Conduit
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ConduitsModifyResponse represents the response from a PATCH request to /helix/eventsub/conduits.
type ConduitsResource ¶
type ConduitsResource struct {
// Shards provides access to the Twitch Shards API.
Shards *ConduitsShardsResource
// contains filtered or unexported fields
}
ConduitsResource represents the Twitch Conduits API.
func NewConduitsResource ¶
func NewConduitsResource(client *Client) *ConduitsResource
NewConduitsResource creates a new ConduitsResource.
func (*ConduitsResource) Delete ¶
func (r *ConduitsResource) Delete(id string) *ConduitsDeleteCall
Delete creates a new DELETE request to /helix/eventsub/conduits.
Deletes a conduit. Note that it may take some time for Eventsub subscriptions on a deleted conduit to show as disabled when calling Get Eventsub Subscriptions.
Authorization ¶
Requires an app access token.
Check the Official Twitch Documentation for more information.
func (*ConduitsResource) Insert ¶
func (r *ConduitsResource) Insert(shardCount int) *ConduitsInsertCall
Insert creates a new POST request to /helix/eventsub/conduits.
Creates a new conduit.
Authorization ¶
Requires an app access token.
Check the Official Twitch Documentation for more information.
func (*ConduitsResource) List ¶
func (r *ConduitsResource) List() *ConduitsListCall
List creates a new GET request to /helix/eventsub/conduits.
Gets all conduits for a client ID.
Authorization ¶
Requires an app access token.
Check the Official Twitch Documentation for more information.
func (*ConduitsResource) Modify ¶ added in v0.4.0
func (r *ConduitsResource) Modify(id string, shardCount int) *ConduitsModifyCall
Modify creates a new PATCH request to /helix/eventsub/conduits.
Updates a conduit's shard count. To delete shards, update the count to a lower number, and the shards above the count will be deleted. For example, if the existing shard count is 100, by resetting shard count to 50, shards 50-99 are disabled.
Authorization ¶
Requires an app access token.
Check the Official Twitch Documentation for more information.
type ConduitsShardListCall ¶ added in v0.4.0
type ConduitsShardListCall struct {
// contains filtered or unexported fields
}
ConduitsShardListCall represents a GET call to a Twitch ConduitsShards API endpoint.
func (*ConduitsShardListCall) After ¶ added in v0.4.0
func (api *ConduitsShardListCall) After(after string) *ConduitsShardListCall
After sets the After query parameter.
func (*ConduitsShardListCall) ConduitID ¶ added in v0.4.0
func (api *ConduitsShardListCall) ConduitID(conduitID string) *ConduitsShardListCall
ConduitID sets the ConduitID query parameter.
func (*ConduitsShardListCall) Do ¶ added in v0.4.0
func (api *ConduitsShardListCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsShardListResponse, error)
Do executes the request.
func (*ConduitsShardListCall) Status ¶ added in v0.4.0
func (api *ConduitsShardListCall) Status(status string) *ConduitsShardListCall
Status sets the Status query parameter.
type ConduitsShardListResponse ¶ added in v0.4.0
type ConduitsShardListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ConduitShard data returned by the Twitch API.
Data []ConduitShard
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ConduitsShardListResponse represents the response from a GET request to /helix/eventsub/conduits/shards.
type ConduitsShardModifyCall ¶ added in v0.4.0
type ConduitsShardModifyCall struct {
// contains filtered or unexported fields
}
ConduitsShardModifyCall represents a PATCH call to a Twitch ConduitsShards API endpoint.
func (*ConduitsShardModifyCall) ConduitID ¶ added in v0.4.0
func (api *ConduitsShardModifyCall) ConduitID(conduitID string) *ConduitsShardModifyCall
ConduitID sets the ConduitID body parameter.
func (*ConduitsShardModifyCall) Do ¶ added in v0.4.0
func (api *ConduitsShardModifyCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsShardModifyResponse, error)
Do executes the request.
func (*ConduitsShardModifyCall) Shards ¶ added in v0.4.0
func (api *ConduitsShardModifyCall) Shards(shardss ...ConduitShard) *ConduitsShardModifyCall
Shards sets the Shards body parameter.
type ConduitsShardModifyResponse ¶ added in v0.4.0
type ConduitsShardModifyResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ConduitShard data returned by the Twitch API.
Data []ConduitShard
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ConduitsShardModifyResponse represents the response from a PATCH request to /helix/eventsub/conduits/shards.
type ConduitsShardsResource ¶ added in v0.4.0
type ConduitsShardsResource struct {
// contains filtered or unexported fields
}
ConduitsShardsResource represents the Twitch ConduitsShards API.
func NewConduitsShardsResource ¶ added in v0.4.0
func NewConduitsShardsResource(client *Client) *ConduitsShardsResource
NewConduitsShardsResource creates a new ConduitsShardsResource.
func (*ConduitsShardsResource) List ¶ added in v0.4.0
func (r *ConduitsShardsResource) List(conduitID string) *ConduitsShardListCall
List creates a new GET request to /helix/eventsub/conduits/shards.
Gets a lists of all shards for a conduit.
Authorization ¶
Requires an app access token.
Check the Official Twitch Documentation for more information.
func (*ConduitsShardsResource) Modify ¶ added in v0.4.0
func (r *ConduitsShardsResource) Modify(conduitID string, shards ConduitShard) *ConduitsShardModifyCall
Modify creates a new PATCH request to /helix/eventsub/conduits/shards.
Updates a conduit shard.
Shard IDs are indexed starting at 0, so a conduit with a shard_count of 5 will have shards with IDs 0 through 4.
Authorization ¶
Requires an app access token.
Check the Official Twitch Documentation for more information.
type ContentClassificationLabel ¶ added in v0.4.0
type ContentClassificationLabel struct {
// ID is the ID of the content classification label.
ID string `json:"id"`
// Name is the name of the content classification label.
Name string `json:"name"`
// Description is the description of the content classification label.
Description string `json:"description"`
}
ContentClassificationLabel represents a content classification label.
type ContentLabelsListCall ¶ added in v0.4.0
type ContentLabelsListCall struct {
// contains filtered or unexported fields
}
ContentLabelsListCall represents a GET call to a Twitch ContentLabels API endpoint.
func (*ContentLabelsListCall) Do ¶ added in v0.4.0
func (api *ContentLabelsListCall) Do(ctx context.Context, opts ...RequestOption) (*ContentLabelsListResponse, error)
Do executes the request.
func (*ContentLabelsListCall) Locale ¶ added in v0.4.0
func (api *ContentLabelsListCall) Locale(locale string) *ContentLabelsListCall
Locale sets the Locale query parameter.
type ContentLabelsListResponse ¶ added in v0.4.0
type ContentLabelsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ContentClassificationLabel data returned by the Twitch API.
Data []ContentClassificationLabel
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ContentLabelsListResponse represents the response from a GET request to /helix/content_classification_labels.
type ContentLabelsResource ¶ added in v0.4.0
type ContentLabelsResource struct {
// contains filtered or unexported fields
}
ContentLabelsResource represents the Twitch ContentLabels API.
func NewContentLabelsResource ¶ added in v0.4.0
func NewContentLabelsResource(client *Client) *ContentLabelsResource
NewContentLabelsResource creates a new ContentLabelsResource.
func (*ContentLabelsResource) List ¶ added in v0.4.0
func (r *ContentLabelsResource) List() *ContentLabelsListCall
List creates a new GET request to /helix/content_classification_labels.
Gets information about Twitch content classification labels.
The locale parameter is a ISO 3166-1 alpha-2 which tells Twitch which translation to use for the response. (Default: en-US)
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type CreateClipInsertCall ¶ added in v0.4.0
type CreateClipInsertCall struct {
// contains filtered or unexported fields
}
CreateClipInsertCall represents a POST call to a Twitch Clips API endpoint.
func (*CreateClipInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *CreateClipInsertCall) BroadcasterID(broadcasterID string) *CreateClipInsertCall
BroadcasterID sets the BroadcasterID query parameter.
func (*CreateClipInsertCall) Do ¶ added in v0.4.0
func (api *CreateClipInsertCall) Do(ctx context.Context, opts ...RequestOption) (*CreateClipInsertResponse, error)
Do executes the request.
func (*CreateClipInsertCall) HasDelay ¶ added in v0.4.0
func (api *CreateClipInsertCall) HasDelay(hasDelay bool) *CreateClipInsertCall
HasDelay sets the HasDelay query parameter.
type CreateClipInsertResponse ¶ added in v0.4.0
type CreateClipInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the EditableClip data returned by the Twitch API.
Data []EditableClip
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
CreateClipInsertResponse represents the response from a POST request to /helix/clips.
type CreatorGoal ¶ added in v0.4.0
type CreatorGoal struct {
// ID is the ID that uniquely identifies the creator goal.
ID string `json:"id"`
// BroadcasterID is the ID of the broadcaster that created the creator goal.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that created the creator goal.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that created the creator goal.
BroadcasterName string `json:"broadcaster_name"`
// Type is the type of the creator goal.
Type string `json:"type"`
// Description is the description of the creator goal.
Description string `json:"description"`
// CurrentAmount is the current amount of progress towards the creator goal.
CurrentAmount int `json:"current_amount"`
// TargetAmount is the target amount of the creator goal.
TargetAmount int `json:"target_amount"`
// CreatedAt is the UTC timestamp of when the creator goal was created.
CreatedAt time.Time `json:"created_at"`
}
CreatorGoal represents a creator goal on a Twitch channel.
type CustomReward ¶
type CustomReward struct {
// RewardID the ID that uniquely identifies the custom reward.
RewardID string `json:"id"`
// BroadcasterID is the ID of the broadcaster that created the custom reward.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that created the custom reward.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that created the custom reward.
BroadcasterName string `json:"broadcaster_name"`
// BackgroundColor is a hex formatted color code representing the background color of the reward.
BackgroundColor string `json:"background_color"`
// Title is the title of the custom reward.
Title string `json:"title"`
// Prompt is the prompt for the custom reward.
Prompt string `json:"prompt"`
// Image is a set of images for the custom reward.
Image *SizedImage `json:"image"`
// DefaultImage is a set of default images for the custom reward.
DefaultImage SizedImage `json:"default_image"`
// MaxPerStreamSetting is the setting for the custom rewards maximum number of redemptions per stream.
MaxPerStreamSetting CustomRewardMaxPerStreamSetting `json:"max_per_stream_setting"`
// MaxPerUserPerStreamSetting is the setting for the custom rewards maximum number of redemptions per user per stream.
MaxPerUserPerStreamSetting CustomRewardMaxPerUserPerStreamSetting `json:"max_per_user_per_stream_setting"`
// GlobalCooldownSetting is the setting for the custom rewards global cooldown.
GlobalCooldownSetting CustomRewardGlobalCooldownSetting `json:"global_cooldown_setting"`
// Cost is the cost of the custom reward.
Cost int64 `json:"cost"`
// TimesRedeemedThisStream is the number of redemptions of the reward in the current stream.
TimesRedeemedThisStream int `json:"redemptions_redeemed_current_stream"`
// Enabled indicates whether the custom reward is enabled.
Enabled bool `json:"is_enabled"`
// Paused indicates whether the custom reward is paused.
Paused bool `json:"is_paused"`
// InStock indicates whether the custom reward is currently in stock.
InStock bool `json:"is_in_stock"`
// IsUserInputRequired indicates whether the custom reward requires user input.
IsUserInputRequired bool `json:"is_user_input_required"`
// RedemptionsSkipRequestQueue indicates whether redemptions for the reward skip the request queue.
RedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"`
// CooldownExpiresAt is the UTC timestamp of when the cooldown for the reward expires.
CooldownExpiresAt *time.Time `json:"cooldown_expires_at,omitempty"`
}
CustomReward represents a Twitch Channel Point custom reward.
type CustomRewardGlobalCooldownSetting ¶ added in v0.4.0
type CustomRewardGlobalCooldownSetting struct {
// Enabled indicates whether the global cooldown setting is enabled.
Enabled bool `json:"is_enabled"`
// Value is the length of the global cooldown in seconds.
Value int64 `json:"global_cooldown_seconds"`
}
CustomRewardGlobalCooldownSetting represents the global cooldown setting for a custom reward.
type CustomRewardMaxPerStreamSetting ¶ added in v0.4.0
type CustomRewardMaxPerStreamSetting struct {
// Enabled indicates whether the max redemptions per stream setting is enabled.
Enabled bool `json:"is_enabled"`
// Value is the maximum number of redemptions a user can make per stream.
Value int64 `json:"max_per_stream"`
}
CustomRewardMaxPerStreamSetting represents the maximum redemptions per stream setting for a custom reward.
type CustomRewardMaxPerUserPerStreamSetting ¶ added in v0.4.0
type CustomRewardMaxPerUserPerStreamSetting struct {
// Enabled indicates whether the max per user per stream setting is enabled.
Enabled bool `json:"is_enabled"`
// Value is the maximum number of redemptions a user can make per stream.
Value int64 `json:"max_per_user_per_stream"`
}
CustomRewardMaxPerUserPerStreamSetting represents the per user per stream setting for a custom reward.
type CustomRewardRedemption ¶
type CustomRewardRedemption struct {
// ID is the ID that uniquely identifies the custom reward redemption.
ID string `json:"id"`
// BroadcasterID is the ID of the broadcaster that created the custom reward.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that created the custom reward.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that created the custom reward.
BroadcasterName string `json:"broadcaster_name"`
// UserID is the ID of the user that redeemed the custom reward.
UserID string `json:"user_id"`
// UserLogin is the login name of the user that redeemed the custom reward.
UserLogin string `json:"user_login"`
// UserName is the display name of the user that redeemed the custom reward.
UserName string `json:"user_name"`
// UserInput is the user input provided by the user when redeeming the custom reward.
UserInput string `json:"user_input"`
// Status is the current status of the custom reward redemption.
Status string `json:"status"`
// Reward is basic information about the custom reward that was redeemed.
Reward RedemptionRewardInfo `json:"reward"`
// RedeemedAt is the UTC timestamp of when the custom reward was redeemed.
RedeemedAt time.Time `json:"redeemed_at"`
}
CustomRewardRedemption represents a Twitch Channel Point custom reward redemption.
type DateRange ¶ added in v0.4.0
type DateRange struct {
// StartedAt is the reporting windows start date.
StartedAt time.Time `json:"started_at"`
// EndedAt is the reporting windows end date.
EndedAt time.Time `json:"ended_at"`
}
DateRange represents a range of dates with a start and end time.
type DownloadableClip ¶ added in v0.4.0
type DownloadableClip struct {
// ClipID is the ID that uniquely identifies the clip.
ClipID string `json:"clip_id"`
// LandscapeDownloadURL is the URL to download the clip in landscape format.
LandscapeDownloadURL string `json:"landscape_download_url"`
// PortraitDownloadURL is the URL to download the clip in portrait format.
PortraitDownloadURL string `json:"portrait_download_url"`
}
DownloadableClip represents downloadable URLs for a Twitch clip.
type DropEntitlement ¶ added in v0.4.0
type DropEntitlement struct {
// ID is the ID that uniquely identifies the drop entitlement.
ID string `json:"id"`
// GameID is the ID of the game associated with the drop entitlement.
GameID string `json:"game_id"`
// BenefitID is the ID of the benefit associated with the drop entitlement.
BenefitID string `json:"benefit_id"`
// UserID is the ID of the user who has the drop entitlement.
UserID string `json:"user_id"`
// FulfillmentStatus is the fulfillment status of the drop entitlement.
FulfillmentStatus string `json:"fulfillment_status"`
// LastUpdatedAt is the UTC timestamp of when the drop entitlement was last updated.
LastUpdatedAt time.Time `json:"last_updated"`
// Timestamp is the UTC timestamp of when the drop entitlement was granted.
Timestamp time.Time `json:"timestamp"`
}
DropEntitlement represents a Twitch drop entitlement.
type DropsEntitlementsListCall ¶ added in v0.4.0
type DropsEntitlementsListCall struct {
// contains filtered or unexported fields
}
DropsEntitlementsListCall represents a GET call to a Twitch EntitlementsDrops API endpoint.
func (*DropsEntitlementsListCall) After ¶ added in v0.4.0
func (api *DropsEntitlementsListCall) After(after string) *DropsEntitlementsListCall
After sets the After query parameter.
func (*DropsEntitlementsListCall) Do ¶ added in v0.4.0
func (api *DropsEntitlementsListCall) Do(ctx context.Context, opts ...RequestOption) (*DropsEntitlementsListResponse, error)
Do executes the request.
func (*DropsEntitlementsListCall) First ¶ added in v0.4.0
func (api *DropsEntitlementsListCall) First(first int) *DropsEntitlementsListCall
First sets the First query parameter.
func (*DropsEntitlementsListCall) FulfillmentStatus ¶ added in v0.4.0
func (api *DropsEntitlementsListCall) FulfillmentStatus(fulfillmentStatus string) *DropsEntitlementsListCall
FulfillmentStatus sets the FulfillmentStatus query parameter.
func (*DropsEntitlementsListCall) GameID ¶ added in v0.4.0
func (api *DropsEntitlementsListCall) GameID(gameID string) *DropsEntitlementsListCall
GameID sets the GameID query parameter.
func (*DropsEntitlementsListCall) ID ¶ added in v0.4.0
func (api *DropsEntitlementsListCall) ID(ids ...string) *DropsEntitlementsListCall
ID adds to the ID query parameter.
func (*DropsEntitlementsListCall) UserID ¶ added in v0.4.0
func (api *DropsEntitlementsListCall) UserID(userID string) *DropsEntitlementsListCall
UserID sets the UserID query parameter.
type DropsEntitlementsListResponse ¶ added in v0.4.0
type DropsEntitlementsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the DropEntitlement data returned by the Twitch API.
Data []DropEntitlement
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
DropsEntitlementsListResponse represents the response from a GET request to /helix/entitlements/drops.
type DropsEntitlementsModifyCall ¶ added in v0.4.0
type DropsEntitlementsModifyCall struct {
// contains filtered or unexported fields
}
DropsEntitlementsModifyCall represents a PATCH call to a Twitch EntitlementsDrops API endpoint.
func (*DropsEntitlementsModifyCall) Do ¶ added in v0.4.0
func (api *DropsEntitlementsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*DropsEntitlementsModifyResponse, error)
Do executes the request.
func (*DropsEntitlementsModifyCall) EntitlementID ¶ added in v0.4.0
func (api *DropsEntitlementsModifyCall) EntitlementID(entitlementIDs ...string) *DropsEntitlementsModifyCall
EntitlementID sets the EntitlementID body parameter.
func (*DropsEntitlementsModifyCall) FulfillmentStatus ¶ added in v0.4.0
func (api *DropsEntitlementsModifyCall) FulfillmentStatus(fulfillmentStatus string) *DropsEntitlementsModifyCall
FulfillmentStatus sets the FulfillmentStatus body parameter.
type DropsEntitlementsModifyResponse ¶ added in v0.4.0
type DropsEntitlementsModifyResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the UpdatedDropEntitlement data returned by the Twitch API.
Data []UpdatedDropEntitlement
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
DropsEntitlementsModifyResponse represents the response from a PATCH request to /helix/entitlements/drops.
type EditableClip ¶ added in v0.4.0
type EditableClip struct {
// ID is the ID that uniquely identifies the clip.
ID string `json:"id"`
// EditURL is a URL that can be used to edit the clip's title and visibility settings.
EditURL string `json:"edit_url"`
}
EditableClip represents links to edit a Twitch clip.
type Emote ¶ added in v0.4.0
type Emote struct {
// ID is the ID of the emote.
ID string `json:"id"`
// OwnerID is the ID of the user who owns the emote. May be empty.
OwnerID string `json:"owner_id,omitempty"`
// Name is the name of the emote.
Name string `json:"name"`
// Tier is the tier of the emote.
Tier string `json:"tier,omitempty"`
// Template is the template of the emote.
Template string `json:"template"`
// EmoteType is the type of the emote.
EmoteType string `json:"emote_type,omitempty"`
// EmoteSetID is the ID of the emote set the emote belongs to.
EmoteSetID string `json:"emote_set_id,omitempty"`
// Format is a list of supported image formats.
Format []string `json:"format"`
// Scale is a list of supported image scales.
Scale []string `json:"scale"`
// ThemeMode is a list of supported theme modes.
ThemeMode []string `json:"theme_mode"`
// Images is a set of sized images for the emote.
Images SizedImage `json:"images"`
}
Emote represents a Twitch emote.
type EmoteSetsListCall ¶ added in v0.4.0
type EmoteSetsListCall struct {
// contains filtered or unexported fields
}
EmoteSetsListCall represents a GET call to a Twitch ChatEmoteSets API endpoint.
func (*EmoteSetsListCall) Do ¶ added in v0.4.0
func (api *EmoteSetsListCall) Do(ctx context.Context, opts ...RequestOption) (*EmoteSetsListResponse, error)
Do executes the request.
func (*EmoteSetsListCall) EmoteSetID ¶ added in v0.4.0
func (api *EmoteSetsListCall) EmoteSetID(emoteSetIDs ...string) *EmoteSetsListCall
EmoteSetID adds to the EmoteSetID query parameter.
type EmoteSetsListResponse ¶ added in v0.4.0
type EmoteSetsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Emote data returned by the Twitch API.
Data []Emote
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
EmoteSetsListResponse represents the response from a GET request to /helix/chat/emotes/set.
type EntitlementsDropsResource ¶ added in v0.4.0
type EntitlementsDropsResource struct {
// contains filtered or unexported fields
}
EntitlementsDropsResource represents the Twitch EntitlementsDrops API.
func NewEntitlementsDropsResource ¶ added in v0.4.0
func NewEntitlementsDropsResource(client *Client) *EntitlementsDropsResource
NewEntitlementsDropsResource creates a new EntitlementsDropsResource.
func (*EntitlementsDropsResource) List ¶ added in v0.4.0
func (r *EntitlementsDropsResource) List() *DropsEntitlementsListCall
List creates a new GET request to /helix/entitlements/drops.
Gets an organization's list of entitlements that have been granted to a game, a user, or both.
Entitlements returned in the response body data are not guaranteed to be sorted by any field returned by the API. To retrieve CLAIMED or FULFILLED entitlements, use the FulfillmentStatus method to filter results. To retrieve entitlements for a specific game, use the GameID method to filter results.
Authorization ¶
Requires an app access token or user access token.
The associated Client ID for the access token must be owned by a user who is a member of the organization that holds ownership of the game.
Check the Official Twitch Documentation for more information.
func (*EntitlementsDropsResource) Modify ¶ added in v0.4.0
func (r *EntitlementsDropsResource) Modify() *DropsEntitlementsModifyCall
Modify creates a new PATCH request to /helix/entitlements/drops.
Updates the Drop entitlement's fulfillment status.
Authorization ¶
Requires an app access token or user access token.
The associated Client ID for the access token must be owned by a user who is a member of the organization that holds ownership of the game.
Check the Official Twitch Documentation for more information.
type EntitlementsResource ¶
type EntitlementsResource struct {
// Drops provides access to the Twitch Drops API.
Drops *EntitlementsDropsResource
// contains filtered or unexported fields
}
EntitlementsResource represents the Twitch Entitlements API.
func NewEntitlementsResource ¶
func NewEntitlementsResource(client *Client) *EntitlementsResource
NewEntitlementsResource creates a new EntitlementsResource.
type EventSubResource ¶
type EventSubResource struct {
// contains filtered or unexported fields
}
EventSubResource represents the Twitch EventSub API.
func NewEventSubResource ¶
func NewEventSubResource(client *Client) *EventSubResource
NewEventSubResource creates a new EventSubResource.
func (*EventSubResource) List ¶ added in v0.4.0
func (r *EventSubResource) List() *EventSubSubscriptionsListCall
List creates a new GET request to /helix/eventsub/subscriptions.
Gets a list of all EventSub subscriptions that the authenticated app has created.
Authorization ¶
Requires an app access token.
Check the Official Twitch Documentation for more information.
type EventSubSubscription ¶ added in v0.4.0
type EventSubSubscription struct {
// ID is the ID that uniquely identifies the subscription.
ID string `json:"id"`
// Status is the current status of the subscription.
Status string `json:"status"`
// Type is the type of event the subscription is for.
Type string `json:"type"`
// Version is the version of the subscription type.
Version string `json:"version"`
// Condition is the condition that triggers the event.
Condition map[string]any `json:"condition"`
// Transport is the transport information for the subscription.
Transport EventSubTransport `json:"transport"`
// Cost is the cost of the subscription in points.
Cost int `json:"cost"`
// TotalCost is the total cost of the subscription in points.
TotalCost int `json:"total_cost"`
// MaxTotalCost is the maximum total cost of the subscription in points.
MaxTotalCost int `json:"max_total_cost"`
// CreatedAt is the UTC timestamp of when the subscription was created.
CreatedAt time.Time `json:"created_at"`
}
EventSubSubscription represents a Twitch EventSub subscription.
type EventSubSubscriptionsListCall ¶ added in v0.4.0
type EventSubSubscriptionsListCall struct {
// contains filtered or unexported fields
}
EventSubSubscriptionsListCall represents a GET call to a Twitch EventSub API endpoint.
func (*EventSubSubscriptionsListCall) After ¶ added in v0.4.0
func (api *EventSubSubscriptionsListCall) After(after string) *EventSubSubscriptionsListCall
After sets the After query parameter.
func (*EventSubSubscriptionsListCall) Do ¶ added in v0.4.0
func (api *EventSubSubscriptionsListCall) Do(ctx context.Context, opts ...RequestOption) (*EventSubSubscriptionsListResponse, error)
Do executes the request.
func (*EventSubSubscriptionsListCall) Status ¶ added in v0.4.0
func (api *EventSubSubscriptionsListCall) Status(status string) *EventSubSubscriptionsListCall
Status sets the Status query parameter.
func (*EventSubSubscriptionsListCall) SubscriptionID ¶ added in v0.4.0
func (api *EventSubSubscriptionsListCall) SubscriptionID(subscriptionID string) *EventSubSubscriptionsListCall
SubscriptionID sets the SubscriptionID query parameter.
func (*EventSubSubscriptionsListCall) Type ¶ added in v0.4.0
func (api *EventSubSubscriptionsListCall) Type(t string) *EventSubSubscriptionsListCall
Type sets the Type query parameter.
func (*EventSubSubscriptionsListCall) UserID ¶ added in v0.4.0
func (api *EventSubSubscriptionsListCall) UserID(userID string) *EventSubSubscriptionsListCall
UserID sets the UserID query parameter.
type EventSubSubscriptionsListResponse ¶ added in v0.4.0
type EventSubSubscriptionsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// TotalCost is the int data returned by the Twitch API.
TotalCost int
// MaxCost is the int data returned by the Twitch API.
MaxCost int
// Data is the EventSubSubscription data returned by the Twitch API.
Data []EventSubSubscription
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
EventSubSubscriptionsListResponse represents the response from a GET request to /helix/eventsub/subscriptions.
type EventSubTransport ¶ added in v0.4.0
type EventSubTransport struct {
// Method is the transport method.
Method string `json:"method"`
// Callback is the callback URL for webhook transports.
Callback string `json:"callback,omitempty"`
// SessionID is the session ID for websocket transports.
SessionID string `json:"session_id,omitempty"`
// ConduitID is the ID of the conduit being used for an EventSub transport.
ConduitID string `json:"conduit_id,omitempty"`
}
EventSubTransport represents the transport information for a Twitch EventSub subscription.
type Extension ¶ added in v0.4.0
type Extension struct {
// ID is the ID that uniquely identifies the extension.
ID string `json:"id"`
// Name is the name of the extension.
Name string `json:"name"`
// IconURL is the URL to the icon of the extension.
IconURL string `json:"icon_url"`
// AuthorName is the name of the extension author.
AuthorName string `json:"author_name"`
// Description is the description of the extension.
Description string `json:"description"`
// PrivacyPolicyURL is the URL to the privacy policy of the extension.
PrivacyPolicyURL string `json:"privacy_policy_url"`
// TermsURL is the URL to the terms of service of the extension.
TermsURL string `json:"eula_tos_url"`
// ConfigurationLocation is the location where the extension configuration is stored.
ConfigurationLocation string `json:"configuration_location"`
// SubscriptionsSupportLevel is the level of subscription support for the extension.
SubscriptionsSupportLevel string `json:"subscriptions_support_level"`
// Summary is the summary of the extension.
Summary string `json:"summary"`
// SupportEmail is the support email for the extension.
SupportEmail string `json:"support_email"`
// State is the current state of the extension.
State string `json:"state"`
// Version is the current version of the extension.
Version string `json:"version"`
// ViewerSummary is the summary of the extension for viewers.
ViewerSummary string `json:"viewer_summary"`
// AllowedConfigURLs is a list of allowed configuration URLs for the extension.
AllowedConfigURLs []string `json:"allowlisted_config_urls"`
// AllowedPanelURLs is a list of allowed panel URLs for the extension.
AllowedPanelURLs []string `json:"allowlisted_panel_urls"`
// ScreenshotURLs is a list of screenshot URLs for the extension.
ScreenshotURLs []string `json:"screenshot_urls"`
// IconURLs is a map of icon URLs for the extension in different sizes.
IconURLs map[string]string `json:"icon_urls"`
// Views is the different views for the extension.
Views ExtensionViews `json:"views"`
// RequestIdentityLink indicates whether the extension requests identity linking for users.
RequestIdentityLink bool `json:"request_identity_link"`
// HasChatSupport indicates whether the extension has chat support.
HasChatSupport bool `json:"has_chat_support"`
// BitsEnabled indicates whether the extension has bits enabled.
BitsEnabled bool `json:"bits_enabled"`
// CanInstall indicates whether the extension can be installed by broadcasters.
CanInstall bool `json:"can_install"`
}
Extension represents a Twitch extension.
type ExtensionAnalyticsListCall ¶ added in v0.4.0
type ExtensionAnalyticsListCall struct {
// contains filtered or unexported fields
}
ExtensionAnalyticsListCall represents a GET call to a Twitch AnalyticsExtensions API endpoint.
func (*ExtensionAnalyticsListCall) After ¶ added in v0.4.0
func (api *ExtensionAnalyticsListCall) After(after string) *ExtensionAnalyticsListCall
After sets the After query parameter.
func (*ExtensionAnalyticsListCall) Do ¶ added in v0.4.0
func (api *ExtensionAnalyticsListCall) Do(ctx context.Context, opts ...RequestOption) (*ExtensionAnalyticsListResponse, error)
Do executes the request.
func (*ExtensionAnalyticsListCall) EndedAt ¶ added in v0.4.0
func (api *ExtensionAnalyticsListCall) EndedAt(endedAt time.Time) *ExtensionAnalyticsListCall
EndedAt sets the EndedAt query parameter.
func (*ExtensionAnalyticsListCall) ExtensionID ¶ added in v0.4.0
func (api *ExtensionAnalyticsListCall) ExtensionID(extensionID string) *ExtensionAnalyticsListCall
ExtensionID sets the ExtensionID query parameter.
func (*ExtensionAnalyticsListCall) First ¶ added in v0.4.0
func (api *ExtensionAnalyticsListCall) First(first int) *ExtensionAnalyticsListCall
First sets the First query parameter.
func (*ExtensionAnalyticsListCall) StartedAt ¶ added in v0.4.0
func (api *ExtensionAnalyticsListCall) StartedAt(startedAt time.Time) *ExtensionAnalyticsListCall
StartedAt sets the StartedAt query parameter.
func (*ExtensionAnalyticsListCall) Type ¶ added in v0.4.0
func (api *ExtensionAnalyticsListCall) Type(t string) *ExtensionAnalyticsListCall
Type sets the Type query parameter.
type ExtensionAnalyticsListResponse ¶ added in v0.4.0
type ExtensionAnalyticsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ExtensionAnalyticsReport data returned by the Twitch API.
Data []ExtensionAnalyticsReport
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ExtensionAnalyticsListResponse represents the response from a GET request to /helix/analytics/extensions.
type ExtensionAnalyticsReport ¶ added in v0.4.0
type ExtensionAnalyticsReport struct {
// ExtensionID is the ID of the extension the analytics report was generated for.
ExtensionID string `json:"extension_id"`
// URL is a temporary link to download the analytics report. Expires after 5 minutes.
URL string `json:"URL"`
// Type is the type of analytics report.
Type string `json:"type"`
// DateRange is the date range for which the analytics report was generated.
DateRange DateRange `json:"date_range"`
}
ExtensionAnalyticsReport represents analytics data for a Twitch extension.
type ExtensionBitsProduct ¶ added in v0.4.0
type ExtensionBitsProduct struct {
// SKU is the stock keeping unit that identifies the product.
SKU string `json:"sku"`
// DisplayName is the display name of the product.
DisplayName string `json:"display_name"`
// Cost is the cost of the product in bits.
Cost ExtensionBitsProductCost `json:"cost"`
// InDevelopment indicates whether the product is in development and not currently available to the public.
InDevelopment bool `json:"in_development"`
// IsBroadcast indicates whether the product is broadcast to all instances of the extension.
IsBroadcast bool `json:"is_broadcast"`
// ExpiresAt is the UTC timestamp of when the product expires.
ExpiresAt *time.Time `json:"expiration,omitempty"`
}
ExtensionBitsProduct represents a bits product for a Twitch extension.
type ExtensionBitsProductCost ¶ added in v0.4.0
type ExtensionBitsProductCost struct {
// Amount is the cost of the product in bits.
Amount int `json:"amount"`
// Type is the type of currency used to purchase the product.
Type string `json:"type"`
}
ExtensionBitsProductCost contains information about the cost of a bits product for a Twitch extension.
type ExtensionComponentView ¶ added in v0.4.0
type ExtensionComponentView struct {
// ViewerURL is the URL to load the extension in a component view.
ViewerURL string `json:"viewer_url"`
// AspectWidth is the aspect width of the component.
AspectWidth int `json:"aspect_width"`
// AspectHeight is the aspect height of the component.
AspectHeight int `json:"aspect_height"`
// AspectRatioX is the aspect ratio X of the component.
AspectRatioX int `json:"aspect_ratio_x"`
// AspectRatioY is the aspect ratio Y of the component.
AspectRatioY int `json:"aspect_ratio_y"`
// ScalePixels is the scale in pixels of the component.
ScalePixels int `json:"scale_pixels"`
// TargetWidth is the target width of the component in pixels.
TargetHeight int `json:"target_height"`
// Size is the size of the component in pixels.
Size int `json:"size"`
// TargetHeight is the target height of the component in pixels.
ZoomPixels int `json:"zoom_pixels"`
// Zoom is whether the component is zoomed.
Zoom bool `json:"zoom"`
// Autoscale is whether the component autoscales.
Autoscale bool `json:"autoscale"`
// CanLinkExternalContent indicates whether the component can link to external content.
CanLinkExternalContent bool `json:"can_link_external_content"`
}
ExtensionComponentView represents the component view for a Twitch extension.
type ExtensionConfigurationSegment ¶ added in v0.4.0
type ExtensionConfigurationSegment struct {
// BroadcasterID is the ID of the broadcaster that owns the extension.
BroadcasterID string `json:"broadcaster_id"`
// Segment is the segment of the extension configuration. Possible values are "broadcaster", "developer", and "global".
Segment string `json:"segment"`
// Content is the content of the extension configuration segment.
Content string `json:"content"`
// Version is the version of the extension configuration segment.
Version string `json:"version"`
}
ExtensionConfigurationSegment represents a configuration segment for a Twitch extension.
type ExtensionLiveChannel ¶ added in v0.4.0
type ExtensionLiveChannel struct {
// BroadcasterID is the ID of the broadcaster that has the extension live.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that has the extension live.
BroadcasterName string `json:"broadcaster_name"`
// GameID is the ID of the game being played on the channel.
GameID string `json:"game_id"`
// GameName is the name of the game being played on the channel.
GameName string `json:"game_name"`
// Title is the stream title for the channel.
Title string `json:"title"`
}
ExtensionLiveChannel represents a live channel for a Twitch extension.
type ExtensionMobileView ¶ added in v0.4.0
type ExtensionMobileView struct {
// ViewerURL is the URL to load the extension in a mobile view.
ViewerURL string `json:"viewer_url"`
}
ExtensionMobileView represents the different views for a Twitch extension.
type ExtensionPanelView ¶ added in v0.4.0
type ExtensionPanelView struct {
// ViewerURL is the URL to load the extension in a panel view.
ViewerURL string `json:"viewer_url"`
// Width is the width of the panel in pixels.
Height int `json:"height"`
// CanLinkExternalContent indicates whether the panel can link to external content.
CanLinkExternalContent bool `json:"can_link_external_content"`
}
ExtensionPanelView represents the panel view for a Twitch extension.
type ExtensionProduct ¶
type ExtensionProduct struct {
// SKU is the stock keeping unit that identifies the product.
SKU string `json:"sku"`
// Domain is the extension domain of the product.
Domain string `json:"domain"`
// Cost is the cost of the product.
Cost ExtensionProductCost `json:"cost"`
// InDevelopment indicates whether the product is in development and not currently available to the public.
InDevelopment bool `json:"inDevelopment"`
// DisplayName is the display name of the product.
DisplayName string `json:"displayName"`
// Broadcast indicates whether the data was broadcast to all instances of the extension.
Broadcast bool `json:"broadcast"`
// Expiration is the UTC timestamp of when the product expires.
Expiration time.Time `json:"expiration"`
}
ExtensionProduct contains information about a product for an extension.
type ExtensionProductCost ¶
type ExtensionProductCost struct {
// Amount is the cost of the product in bits.
Amount int `json:"amount"`
// Type is the type of currency used to purchase the product.
Type string `json:"type"`
}
ExtensionProductCost contains information about the cost of a product for an extension.
type ExtensionSecret ¶ added in v0.4.0
type ExtensionSecret struct {
// FormatVersion is the version of the secret format.
FormatVersion int `json:"format_version"`
// Secrets is a list of secrets for the extension.
Secrets []ExtensionSecretItem `json:"secrets"`
}
ExtensionSecret represents the secrets for a Twitch extension.
type ExtensionSecretItem ¶ added in v0.4.0
type ExtensionSecretItem struct {
// Content is the content of the secret.
Content string `json:"content"`
// ActiveAt is the UTC timestamp of when the secret was activated.
ActiveAt time.Time `json:"active_at"`
// ExpiresAt is the UTC timestamp of when the secret expires.
ExpiresAt time.Time `json:"expires_at"`
}
ExtensionSecretItem represents a single secret for a Twitch extension.
type ExtensionTransaction ¶
type ExtensionTransaction struct {
// ID is the ID of the transaction.
ID string `json:"id"`
// BroadcasterID is the ID of the broadcaster the transaction occurred in.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster the transaction occurred in.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster the transaction occurred in.
BroadcasterName string `json:"broadcaster_name"`
// UserID is the ID of the user that made the transaction.
UserID string `json:"user_id"`
// UserLogin is the login name of the user that made the transaction.
UserLogin string `json:"user_login"`
// UserName is the display name of the user that made the transaction.
UserName string `json:"user_name"`
// ProductType is the type of product that was purchased.
ProductType string `json:"product_type"`
// Product is information about the product that was purchased.
Product ExtensionProduct `json:"product_data"`
// Timestamp is the UTC timestamp of when the transaction occurred.
Timestamp time.Time `json:"timestamp"`
}
ExtensionTransaction contains information about a transaction for an extension.
type ExtensionVideoOverlayView ¶ added in v0.4.0
type ExtensionVideoOverlayView struct {
// ViewerURL is the URL to load the extension in a video overlay view.
ViewerURL string `json:"viewer_url"`
// CanLinkExternalContent indicates whether the video overlay can link to external content.
CanLinkExternalContent bool `json:"can_link_external_content"`
}
ExtensionVideoOverlayView represents the video overlay view for a Twitch extension.
type ExtensionViews ¶ added in v0.4.0
type ExtensionViews struct {
// Mobile is the mobile view for the extension.
Mobile *ExtensionMobileView `json:"mobile,omitempty"`
// Panel is the panel view for the extension.
Panel *ExtensionPanelView `json:"panel,omitempty"`
// VideoOverlay is the video overlay view for the extension.
VideoOverlay *ExtensionVideoOverlayView `json:"video_overlay,omitempty"`
// Component is the component view for the extension.
Component *ExtensionComponentView `json:"component,omitempty"`
}
ExtensionViews represents the different views for a Twitch extension.
type ExtensionsListCall ¶ added in v0.4.0
type ExtensionsListCall struct {
// contains filtered or unexported fields
}
ExtensionsListCall represents a GET call to a Twitch Extensions API endpoint.
func (*ExtensionsListCall) Do ¶ added in v0.4.0
func (api *ExtensionsListCall) Do(ctx context.Context, opts ...RequestOption) (*ExtensionsListResponse, error)
Do executes the request.
func (*ExtensionsListCall) ExtensionID ¶ added in v0.4.0
func (api *ExtensionsListCall) ExtensionID(extensionID string) *ExtensionsListCall
ExtensionID sets the ExtensionID query parameter.
func (*ExtensionsListCall) ExtensionVersion ¶ added in v0.4.0
func (api *ExtensionsListCall) ExtensionVersion(extensionVersion string) *ExtensionsListCall
ExtensionVersion sets the ExtensionVersion query parameter.
type ExtensionsListResponse ¶ added in v0.4.0
type ExtensionsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Extension data returned by the Twitch API.
Data []Extension
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
ExtensionsListResponse represents the response from a GET request to /helix/extensions.
type ExtensionsResource ¶
type ExtensionsResource struct {
// contains filtered or unexported fields
}
ExtensionsResource represents the Twitch Extensions API.
func NewExtensionsResource ¶
func NewExtensionsResource(client *Client) *ExtensionsResource
NewExtensionsResource creates a new ExtensionsResource.
func (*ExtensionsResource) List ¶ added in v0.4.0
func (r *ExtensionsResource) List(extensionID string) *ExtensionsListCall
List creates a new GET request to /helix/extensions.
Gets information about an extension.
Authorization ¶
Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). The signed JWT must include the "role" field (see JWT Schema), and the "role" field must be set to external.
Check the Official Twitch Documentation for more information.
type Followed ¶ added in v0.4.0
type Followed struct {
// BroadcasterID is the ID of the broadcaster being followed.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster being followed.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster being followed.
BroadcasterName string `json:"broadcaster_name"`
// FollowedAt is the UTC timestamp of when the channel was followed.
FollowedAt time.Time `json:"followed_at"`
}
Followed represents a Twitch channel followed by a channel.
type Follower ¶ added in v0.4.0
type Follower struct {
// UserID is the ID of the user who follows the channel.
UserID string `json:"user_id"`
// UserLogin is the login name of the user who follows the channel.
UserLogin string `json:"user_login"`
// UserName is the display name of the user who follows the channel.
UserName string `json:"user_name"`
// FollowedAt is the UTC timestamp of when the user followed the channel.
FollowedAt time.Time `json:"followed_at"`
}
Follower represents a user who follows a Twitch channel.
type Game ¶
type Game struct {
// ID is the ID that uniquely identifies the game.
ID string `json:"id"`
// Name is the name of the game.
Name string `json:"name"`
// BoxArtURL is the URL to the box art of the game.
BoxArtURL string `json:"box_art_url"`
// IGDB is the ID of the game in the IGDB database.
IGDB string `json:"igdb_id"`
}
Game represents a game on Twitch.
type GameAnalyticsListCall ¶ added in v0.4.0
type GameAnalyticsListCall struct {
// contains filtered or unexported fields
}
GameAnalyticsListCall represents a GET call to a Twitch AnalyticsGames API endpoint.
func (*GameAnalyticsListCall) After ¶ added in v0.4.0
func (api *GameAnalyticsListCall) After(after string) *GameAnalyticsListCall
After sets the After query parameter.
func (*GameAnalyticsListCall) Do ¶ added in v0.4.0
func (api *GameAnalyticsListCall) Do(ctx context.Context, opts ...RequestOption) (*GameAnalyticsListResponse, error)
Do executes the request.
func (*GameAnalyticsListCall) EndedAt ¶ added in v0.4.0
func (api *GameAnalyticsListCall) EndedAt(endedAt time.Time) *GameAnalyticsListCall
EndedAt sets the EndedAt query parameter.
func (*GameAnalyticsListCall) First ¶ added in v0.4.0
func (api *GameAnalyticsListCall) First(first int) *GameAnalyticsListCall
First sets the First query parameter.
func (*GameAnalyticsListCall) GameID ¶ added in v0.4.0
func (api *GameAnalyticsListCall) GameID(gameID string) *GameAnalyticsListCall
GameID sets the GameID query parameter.
func (*GameAnalyticsListCall) StartedAt ¶ added in v0.4.0
func (api *GameAnalyticsListCall) StartedAt(startedAt time.Time) *GameAnalyticsListCall
StartedAt sets the StartedAt query parameter.
func (*GameAnalyticsListCall) Type ¶ added in v0.4.0
func (api *GameAnalyticsListCall) Type(t string) *GameAnalyticsListCall
Type sets the Type query parameter.
type GameAnalyticsListResponse ¶ added in v0.4.0
type GameAnalyticsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the GameAnalyticsReport data returned by the Twitch API.
Data []GameAnalyticsReport
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
GameAnalyticsListResponse represents the response from a GET request to /helix/analytics/games.
type GameAnalyticsReport ¶ added in v0.4.0
type GameAnalyticsReport struct {
// GameID is the ID of the game the analytics report was generated for.
GameID string `json:"game_id"`
// URL is a temporary link to download the analytics report. Expires after 5 minutes.
URL string `json:"URL"`
// Type is the type of analytics report.
Type string `json:"type"`
// DateRange is the date range for which the analytics report was generated.
DateRange DateRange `json:"date_range"`
}
GameAnalyticsReport represents analytics data for a Twitch game.
type GamesListCall ¶ added in v0.4.0
type GamesListCall struct {
// contains filtered or unexported fields
}
GamesListCall represents a GET call to a Twitch Games API endpoint.
func (*GamesListCall) Do ¶ added in v0.4.0
func (api *GamesListCall) Do(ctx context.Context, opts ...RequestOption) (*GamesListResponse, error)
Do executes the request.
func (*GamesListCall) ID ¶ added in v0.4.0
func (api *GamesListCall) ID(ids ...string) *GamesListCall
ID adds to the ID query parameter.
func (*GamesListCall) IGDB ¶ added in v0.4.0
func (api *GamesListCall) IGDB(iGDBs ...string) *GamesListCall
IGDB adds to the IGDB query parameter.
func (*GamesListCall) Name ¶ added in v0.4.0
func (api *GamesListCall) Name(names ...string) *GamesListCall
Name adds to the Name query parameter.
type GamesListResponse ¶ added in v0.4.0
type GamesListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Game data returned by the Twitch API.
Data []Game
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
GamesListResponse represents the response from a GET request to /helix/games.
type GamesResource ¶
type GamesResource struct {
// Top provides access to the Twitch Top API.
Top *GamesTopResource
// contains filtered or unexported fields
}
GamesResource represents the Twitch Games API.
func NewGamesResource ¶
func NewGamesResource(client *Client) *GamesResource
NewGamesResource creates a new GamesResource.
func (*GamesResource) List ¶ added in v0.4.0
func (r *GamesResource) List() *GamesListCall
List creates a new GET request to /helix/games.
Gets information about one or more specified games.
Check the Official Twitch Documentation for more information.
type GamesTopResource ¶ added in v0.4.0
type GamesTopResource struct {
// contains filtered or unexported fields
}
GamesTopResource represents the Twitch GamesTop API.
func NewGamesTopResource ¶ added in v0.4.0
func NewGamesTopResource(client *Client) *GamesTopResource
NewGamesTopResource creates a new GamesTopResource.
func (*GamesTopResource) List ¶ added in v0.4.0
func (r *GamesTopResource) List() *TopGamesListCall
List creates a new GET request to /helix/games/top.
Gets information about all broadcasts on Twitch.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type GlobalChatBadgesListCall ¶ added in v0.4.0
type GlobalChatBadgesListCall struct {
// contains filtered or unexported fields
}
GlobalChatBadgesListCall represents a GET call to a Twitch ChatBadgesGlobal API endpoint.
func (*GlobalChatBadgesListCall) Do ¶ added in v0.4.0
func (api *GlobalChatBadgesListCall) Do(ctx context.Context, opts ...RequestOption) (*GlobalChatBadgesListResponse, error)
Do executes the request.
type GlobalChatBadgesListResponse ¶ added in v0.4.0
type GlobalChatBadgesListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ChatBadge data returned by the Twitch API.
Data []ChatBadge
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
GlobalChatBadgesListResponse represents the response from a GET request to /helix/chat/badges/global.
type GlobalEmotesListCall ¶ added in v0.4.0
type GlobalEmotesListCall struct {
// contains filtered or unexported fields
}
GlobalEmotesListCall represents a GET call to a Twitch ChatEmotesGlobal API endpoint.
func (*GlobalEmotesListCall) Do ¶ added in v0.4.0
func (api *GlobalEmotesListCall) Do(ctx context.Context, opts ...RequestOption) (*GlobalEmotesListResponse, error)
Do executes the request.
type GlobalEmotesListResponse ¶ added in v0.4.0
type GlobalEmotesListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Emote data returned by the Twitch API.
Data []Emote
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
GlobalEmotesListResponse represents the response from a GET request to /helix/chat/emotes/global.
type GoalsListCall ¶ added in v0.4.0
type GoalsListCall struct {
// contains filtered or unexported fields
}
GoalsListCall represents a GET call to a Twitch Goals API endpoint.
func (*GoalsListCall) BroadcasterID ¶ added in v0.4.0
func (api *GoalsListCall) BroadcasterID(broadcasterID string) *GoalsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*GoalsListCall) Do ¶ added in v0.4.0
func (api *GoalsListCall) Do(ctx context.Context, opts ...RequestOption) (*GoalsListResponse, error)
Do executes the request.
type GoalsListResponse ¶ added in v0.4.0
type GoalsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the CreatorGoal data returned by the Twitch API.
Data []CreatorGoal
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
GoalsListResponse represents the response from a GET request to /helix/goals.
type GoalsResource ¶
type GoalsResource struct {
// contains filtered or unexported fields
}
GoalsResource represents the Twitch Goals API.
func NewGoalsResource ¶
func NewGoalsResource(client *Client) *GoalsResource
NewGoalsResource creates a new GoalsResource.
func (*GoalsResource) List ¶ added in v0.4.0
func (r *GoalsResource) List(broadcasterID string) *GoalsListCall
List creates a new GET request to /helix/goals.
Gets the broadcaster's list of active goals. Use this endpoint to get the current progress of each goal.
Authorization ¶
Requires a user access token that includes the channel:read:goals scope.
Check the Official Twitch Documentation for more information.
type GuestStarGuest ¶ added in v0.4.0
type GuestStarGuest struct {
// SlotID is the ID of the slot assigned to the guest.
SlotID string `json:"slot_id"`
// IsLive indicates whether the guest is currently live in the session.
IsLive bool `json:"is_live"`
// UserID is the ID of the guest user.
UserID string `json:"user_id"`
// UserLogin is the login name of the guest user.
UserLogin string `json:"user_login"`
// UserName is the display name of the guest user.
UserName string `json:"user_display_name"`
// Volume is the volume level of the guest user.
Volume int `json:"volume"`
// AudioSettings is the audio settings for the guest user.
AudioSettings MediaSettings `json:"audio_settings"`
// VideoSettings is the video settings for the guest user.
VideoSettings MediaSettings `json:"video_settings"`
// AssignedAt is the UTC timestamp of when the guest was assigned to the slot.
AssignedAt time.Time `json:"assigned_at"`
// JoinedAt is the UTC timestamp of when the guest joined the session.
JoinedAt time.Time `json:"joined_at"`
}
GuestStarGuest represents a guest in a guest star session.
type GuestStarInvite ¶ added in v0.4.0
type GuestStarInvite struct {
// UserID is the ID of the user who was invited.
UserID string `json:"user_id"`
// Status is the status of the invite.
Status string `json:"status"`
// IsAudioAvailable indicates whether audio is available for the invite.
IsAudioAvailable bool `json:"is_audio_available"`
// IsVideoAvailable indicates whether video is available for the invite.
IsVideoAvailable bool `json:"is_video_available"`
// IsAudioEnabled indicates whether audio is enabled for the invite.
IsAudioEnabled bool `json:"is_audio_enabled"`
// IsVideoEnabled indicates whether video is enabled for the invite.
IsVideoEnabled bool `json:"is_video_enabled"`
// InvitedAt is the UTC timestamp of when the user was invited.
InvitedAt time.Time `json:"invited_at"`
}
GuestStarInvite represents an invite to a guest star session.
type GuestStarResource ¶
type GuestStarResource struct {
// Session provides access to the Twitch Session API.
Session *GuestStarSessionResource
// contains filtered or unexported fields
}
GuestStarResource represents the Twitch GuestStar API.
func NewGuestStarResource ¶
func NewGuestStarResource(client *Client) *GuestStarResource
NewGuestStarResource creates a new GuestStarResource.
func (*GuestStarResource) List ¶ added in v0.4.0
func (r *GuestStarResource) List(broadcasterID string, moderatorID string) *GuestStarSessionListCall
List creates a new GET request to /helix/guest_star/session.
Gets information about an ongoing Guest Star session for a particular channel.
Authorization ¶
Requires OAuth Scope: channel:read:guest_star, channel:manage:guest_star, moderator:read:guest_star or moderator:manage:guest_star.
Guests must be either invited or assigned a slot within the session.
Check the Official Twitch Documentation for more information.
type GuestStarSession ¶ added in v0.4.0
type GuestStarSession struct {
// ID is the ID that uniquely identifies the guest star session.
ID string `json:"id"`
// Guests is a list of guests in the guest star session.
Guests []GuestStarGuest `json:"guests"`
}
GuestStarSession represents a guest star session on a Twitch channel.
type GuestStarSessionListCall ¶ added in v0.4.0
type GuestStarSessionListCall struct {
// contains filtered or unexported fields
}
GuestStarSessionListCall represents a GET call to a Twitch GuestStar API endpoint.
func (*GuestStarSessionListCall) BroadcasterID ¶ added in v0.4.0
func (api *GuestStarSessionListCall) BroadcasterID(broadcasterID string) *GuestStarSessionListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*GuestStarSessionListCall) Do ¶ added in v0.4.0
func (api *GuestStarSessionListCall) Do(ctx context.Context, opts ...RequestOption) (*GuestStarSessionListResponse, error)
Do executes the request.
func (*GuestStarSessionListCall) ModeratorID ¶ added in v0.4.0
func (api *GuestStarSessionListCall) ModeratorID(moderatorID string) *GuestStarSessionListCall
ModeratorID sets the ModeratorID query parameter.
type GuestStarSessionListResponse ¶ added in v0.4.0
type GuestStarSessionListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the GuestStarSession data returned by the Twitch API.
Data []GuestStarSession
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
GuestStarSessionListResponse represents the response from a GET request to /helix/guest_star/session.
type GuestStarSessionResource ¶ added in v0.4.0
type GuestStarSessionResource struct {
// contains filtered or unexported fields
}
GuestStarSessionResource represents the Twitch GuestStarSession API.
func NewGuestStarSessionResource ¶ added in v0.4.0
func NewGuestStarSessionResource(client *Client) *GuestStarSessionResource
NewGuestStarSessionResource creates a new GuestStarSessionResource.
type HTTPClient ¶
HTTPClient is an interface for implementing outbound HTTP requests.
type HypeTrainContribution ¶ added in v0.4.0
type HypeTrainContribution struct {
// UserID is the ID of the user who made the contribution.
UserID string `json:"user_id"`
// UserLogin is the login name of the user who made the contribution.
UserLogin string `json:"user_login"`
// UserName is the display name of the user who made the contribution.
UserName string `json:"user_name"`
// Type is the type of contribution.
Type string `json:"type"`
// Total is the total number of points contributed by the user.
Total int `json:"total"`
}
HypeTrainContribution represents a contribution made to a Hype Train.
type HypeTrainEvent ¶ added in v0.4.0
type HypeTrainEvent struct {
// ID is the ID that uniquely identifies the Hype Train event.
ID string `json:"id"`
// EventType is the type of the Hype Train event.
EventType string `json:"event_type"`
// Version is the version of the Hype Train event.
Version string `json:"version"`
// EventData provides information about the Hype Train event.
EventData HypeTrainEventData `json:"event_data"`
// EventTimestamp is the UTC timestamp of when the Hype Train event occurred.
EventTimestamp time.Time `json:"event_timestamp"`
}
HypeTrainEvent represents a Hype Train event on a Twitch channel.
type HypeTrainEventContribution ¶ added in v0.4.0
type HypeTrainEventContribution struct {
// Type is the type of contribution.
Type string `json:"type"`
// UserID is the ID of the user who made the contribution.
UserID string `json:"user"`
// Total is the total number of points contributed by the user.
Total int `json:"total"`
}
HypeTrainEventContribution represents a contribution made to a Hype Train.
type HypeTrainEventData ¶ added in v0.4.0
type HypeTrainEventData struct {
// ID is the ID that uniquely identifies the Hype Train.
ID string `json:"id"`
// BroadcasterID is the ID of the broadcaster that the Hype Train event occurred on.
BroadcasterID string `json:"broadcaster_id"`
// Goal is the number of points required to reach the next level of the Hype Train.
Goal int `json:"goal"`
// Total is the total number of points contributed to the Hype Train so far.
Total int `json:"total"`
// Level is the current level of the Hype Train.
Level int `json:"level"`
// LastContribution is information about the last contribution made to the Hype Train.
LastContribution HypeTrainEventContribution `json:"last_contribution"`
// TopContributions is a list of the top contributions made to the Hype Train.
TopContributions []HypeTrainEventContribution `json:"top_contributions"`
// CooldownEndTime is the UTC timestamp of when the Hype Train cooldown ends.
CooldownEndTime time.Time `json:"cooldown_end_time"`
// StartedAt is the UTC timestamp of when the Hype Train started.
StartedAt time.Time `json:"started_at"`
// ExpiresAt is the UTC timestamp of when the Hype Train expires.
ExpiresAt time.Time `json:"expires_at"`
}
HypeTrainEventData provides information about a Hype Train event.
type HypeTrainParticipant ¶ added in v0.4.0
type HypeTrainParticipant struct {
// BroadcasterID is the ID of the broadcaster that is a participant in the shared Hype Train.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that is a participant in the shared Hype Train.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that is a participant in the shared Hype Train.
BroadcasterName string `json:"broadcaster_name"`
}
HypeTrainParticipant represents a participant in a shared Hype Train.
type HypeTrainRecord ¶ added in v0.4.0
type HypeTrainRecord struct {
// Level is the highest level reached during the Hype Train.
Level int `json:"level"`
// Total is the total number of points contributed during the Hype Train.
Total int `json:"total"`
// AchievedAt is the UTC timestamp of when the Hype Train was completed.
AchievedAt time.Time `json:"achieved_at"`
}
HypeTrainRecord represents a record of a completed Hype Train on a Twitch channel.
type HypeTrainResource ¶
type HypeTrainResource struct {
// contains filtered or unexported fields
}
HypeTrainResource represents the Twitch HypeTrain API.
func NewHypeTrainResource ¶
func NewHypeTrainResource(client *Client) *HypeTrainResource
NewHypeTrainResource creates a new HypeTrainResource.
func (*HypeTrainResource) List ¶ added in v0.4.0
func (r *HypeTrainResource) List(broadcasterID string) *HypeTrainStatusListCall
List creates a new GET request to /helix/hypetrain/status.
Get the status of a Hype Train for the specified broadcaster.
Authorization ¶
Requires an user access token.
Requires OAuth Scope: channel:read:hype_train.
Requires that the user access token belongs to BroadcasterID.
Check the Official Twitch Documentation for more information.
type HypeTrainStatus ¶ added in v0.4.0
type HypeTrainStatus struct {
// ID is the ID that uniquely identifies the Hype Train.
ID string `json:"id"`
// Type is the type of the Hype Train.
Type string `json:"type"`
// BroadcasterID is the ID of the broadcaster that the Hype Train is occurring on.
BroadcasterID string `json:"broadcaster_user_id"`
// BroadcasterLogin is the login name of the broadcaster that the Hype Train is occurring on.
BroadcasterLogin string `json:"broadcaster_user_login"`
// BroadcasterName is the display name of the broadcaster that the Hype Train is occurring on.
BroadcasterName string `json:"broadcaster_user_name"`
// Level is the level of the Hype Train.
Level int `json:"level"`
// Total is the total number of points contributed to the Hype Train so far.
Total int `json:"total"`
// Progress is the progress towards the next level of the Hype Train.
Progress int `json:"progress"`
// Goal is the number of points required to reach the next level of the Hype Train.
Goal int `json:"goal"`
// TopContributions is a list of the top contributions made to the Hype Train.
TopContributions []HypeTrainContribution `json:"top_contributions"`
SharedTrainParticipants []string `json:"shared_train_participants"`
// StartedAt is the UTC timestamp of when the Hype Train started.
StartedAt time.Time `json:"started_at"`
// ExpiresAt is the UTC timestamp of when the Hype Train expires.
ExpiresAt time.Time `json:"expires_at"`
}
HypeTrainStatus represents the status of a Hype Train on a Twitch channel.
type HypeTrainStatusInfo ¶ added in v0.4.0
type HypeTrainStatusInfo struct {
// Current is the current status of the Hype Train, if one is active.
Current *HypeTrainStatus `json:"current,omitempty"`
// AllTimeHigh is the highest level reached during a Hype Train on the channel.
AllTimeHigh *HypeTrainRecord `json:"all_time_high,omitempty"`
SharedAllTimeHigh *HypeTrainRecord `json:"shared_all_time_high,omitempty"`
}
HypeTrainStatusInfo represents the status information of a Hype Train on a Twitch channel.
type HypeTrainStatusListCall ¶ added in v0.4.0
type HypeTrainStatusListCall struct {
// contains filtered or unexported fields
}
HypeTrainStatusListCall represents a GET call to a Twitch HypeTrain API endpoint.
func (*HypeTrainStatusListCall) BroadcasterID ¶ added in v0.4.0
func (api *HypeTrainStatusListCall) BroadcasterID(broadcasterID string) *HypeTrainStatusListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*HypeTrainStatusListCall) Do ¶ added in v0.4.0
func (api *HypeTrainStatusListCall) Do(ctx context.Context, opts ...RequestOption) (*HypeTrainStatusListResponse, error)
Do executes the request.
type HypeTrainStatusListResponse ¶ added in v0.4.0
type HypeTrainStatusListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the HypeTrainStatusInfo data returned by the Twitch API.
Data []HypeTrainStatusInfo
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
HypeTrainStatusListResponse represents the response from a GET request to /helix/hypetrain/status.
type InitializedRaid ¶ added in v0.4.0
type InitializedRaid struct {
// Mature indicates whether the channel being raided contains mature content.
Mature bool `json:"is_mature"`
// CreatedAt is the UTC timestamp of when the raid was created.
CreatedAt time.Time `json:"created_at"`
}
InitializedRaid represents a raid that has been initialized on a Twitch channel.
type IssuedBan ¶ added in v0.4.0
type IssuedBan struct {
// BroadcasterID is the ID of the broadcaster that issued the ban.
BroadcasterID string `json:"broadcaster_id"`
// ModeratorID is the ID of the moderator that issued the ban.
ModeratorID string `json:"moderator_id"`
// UserID is the ID of the user that was banned.
UserID string `json:"user_id"`
// CreatedAt is the UTC timestamp of when the ban was issued.
CreatedAt time.Time `json:"created_at"`
// ExpiresAt is the UTC timestamp of when the ban expires, if applicable.
ExpiresAt *time.Time `json:"end_time,omitempty"`
}
IssuedBan represents a ban that has been issued on a Twitch channel.
type MediaSettings ¶ added in v0.4.0
type MediaSettings struct {
// IsHostEnabled indicates whether the host is enabled.
IsHostEnabled bool `json:"is_host_enabled"`
// IsGuestEnabled indicates whether the guest is enabled.
IsGuestEnabled bool `json:"is_guest_enabled"`
// IsAvailable indicates whether the media is available.
IsAvailable bool `json:"is_available"`
}
MediaSettings represents the media settings.
type ModeratedChannel ¶ added in v0.4.0
type ModeratedChannel struct {
// BroadcasterID is the ID of the broadcaster that the user moderates.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that the user moderates.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that the user moderates.
BroadcasterName string `json:"broadcaster_name"`
}
ModeratedChannel represents a Twitch channel a user moderates.
type ModerationBansResource ¶ added in v0.4.0
type ModerationBansResource struct {
// contains filtered or unexported fields
}
ModerationBansResource represents the Twitch ModerationBans API.
func NewModerationBansResource ¶ added in v0.4.0
func NewModerationBansResource(client *Client) *ModerationBansResource
NewModerationBansResource creates a new ModerationBansResource.
func (*ModerationBansResource) Delete ¶ added in v0.4.0
func (r *ModerationBansResource) Delete(broadcasterID string, moderatorID string, userID string) *UnbanUserDeleteCall
Delete creates a new DELETE request to /helix/moderation/bans.
Removes the ban or timeout that was placed on the specified user.
Authorization ¶
Requires a user access token that includes the moderator:manage:banned_users scope.
Check the Official Twitch Documentation for more information.
func (*ModerationBansResource) Insert ¶ added in v0.4.0
func (r *ModerationBansResource) Insert(broadcasterID string, moderatorID string, ban OutboundBan) *BanUserInsertCall
Insert creates a new POST request to /helix/moderation/bans.
Bans a user from participating in the specified broadcaster's chat room or puts them in a timeout.
If the user is currently in a timeout, you can call this endpoint to change the duration of the timeout or ban them altogether. If the user is currently banned, you cannot call this method to put them in a timeout instead.
Authorization ¶
Requires a user access token that includes the moderator:manage:banned_users scope.
Check the Official Twitch Documentation for more information.
type ModerationClearChatResource ¶ added in v0.4.0
type ModerationClearChatResource struct {
// contains filtered or unexported fields
}
ModerationClearChatResource represents the Twitch ModerationClearChat API.
func NewModerationClearChatResource ¶ added in v0.4.0
func NewModerationClearChatResource(client *Client) *ModerationClearChatResource
NewModerationClearChatResource creates a new ModerationClearChatResource.
func (*ModerationClearChatResource) Delete ¶ added in v0.4.0
func (r *ModerationClearChatResource) Delete(broadcasterID string, moderatorID string) *ChatMessagesDeleteCall
Delete creates a new DELETE request to /helix/moderation/chat.
Removes a single chat message or all chat messages from the broadcaster's chat room.
Authorization ¶
Requires a user access token that includes the moderator:manage:chat_messages scope.
Check the Official Twitch Documentation for more information.
type ModerationResource ¶
type ModerationResource struct {
// Bans provides access to the Twitch Bans API.
Bans *ModerationBansResource
// ClearChat provides access to the Twitch ClearChat API.
ClearChat *ModerationClearChatResource
// contains filtered or unexported fields
}
ModerationResource represents the Twitch Moderation API.
func NewModerationResource ¶
func NewModerationResource(client *Client) *ModerationResource
NewModerationResource creates a new ModerationResource.
type OutboundBan ¶ added in v0.4.0
type OutboundBan struct {
// UserID is the ID of the user to be banned.
UserID string `json:"user_id"`
// Reason is the reason for the ban. Maximum length: 500 characters.
Reason string `json:"reason,omitempty"`
// Duration is the duration of the ban in seconds. If not specified, the ban is permanent.
Duration *int `json:"duration,omitempty"`
}
OutboundBan represents a request to ban a user from a Twitch channel.
func WithPermanentBan ¶ added in v0.4.0
func WithPermanentBan(userID, reason string) OutboundBan
WithPermanentBan creates a new outbound prediction outcome with the given title.
func WithTimeout ¶ added in v0.4.0
func WithTimeout(userID, reason string, duration time.Duration) OutboundBan
WithTimeout creates a new outbound ban with a timeout duration in seconds.
type OutboundChatMessage ¶ added in v0.4.0
type OutboundChatMessage struct {
// MessageID is the ID of the message that was sent.
MessageID string `json:"message_id"`
// IsSent indicates whether the message was successfully sent.
IsSent bool `json:"is_sent"`
// DropReason is the reason the message was not sent, if applicable.
DropReason *OutboundChatMessageDropReason `json:"drop_reason,omitempty"`
}
OutboundChatMessage represents the result of an attempt to send a message in chat.
type OutboundChatMessageDropReason ¶ added in v0.4.0
type OutboundChatMessageDropReason struct {
// Code is the code representing the reason the message was not sent.
Code string `json:"code"`
// Message is a message describing the reason the message was not sent.
Message string `json:"message"`
}
OutboundChatMessageDropReason represents the reason a chat message was not sent.
type OutboundChoice ¶ added in v0.4.0
type OutboundChoice struct {
// Title is the title of the choice.
Title string `json:"title"`
}
OutboundChoice represents a choice when creating a new Twitch poll or prediction.
func WithChoice ¶ added in v0.4.0
func WithChoice(title string) OutboundChoice
WithChoice creates a new outbound choice with the given title.
type OutboundPredictionOutcome ¶ added in v0.4.0
type OutboundPredictionOutcome struct {
// Title is the title of the outcome.
Title string `json:"title"`
}
OutboundPredictionOutcome represents an outcome when creating a new Twitch prediction.
type Pagination ¶
type Pagination struct {
Cursor string `json:"cursor,omitempty"`
}
Pagination represents pagination information in a Twitch API response.
type Poll ¶ added in v0.4.0
type Poll struct {
// ID is the ID that uniquely identifies the poll.
ID string `json:"id"`
// Status is the current status of the poll.
Status string `json:"status"`
// BroadcasterID is the ID of the broadcaster that created the poll.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that created the poll.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that created the poll.
BroadcasterName string `json:"broadcaster_name"`
// Title is the title of the poll.
Title string `json:"title"`
// Choices is a list of choices in the poll.
Choices []PollChoice `json:"choices"`
// BitsVotingEnabled indicates whether voting with bits is enabled for the poll.
BitsVotingEnabled bool `json:"bits_voting_enabled"`
// ChannelPointsVotingEnabled indicates whether voting with channel points is enabled for the poll.
ChannelPointsVotingEnabled bool `json:"channel_points_voting_enabled"`
// BitsPerVote is the number of bits required to cast a vote, if bits voting is enabled.
BitsPerVote int `json:"bits_per_vote"`
// ChannelPointsPerVote is the number of channel points required to cast a vote, if channel points voting is enabled.
ChannelPointsPerVote int `json:"channel_points_per_vote"`
// Duration is the duration of the poll in seconds.
Duration int `json:"duration"`
// StartedAt is the UTC timestamp of when the poll started.
StartedAt time.Time `json:"started_at"`
// EndedAt is the UTC timestamp of when the poll ended, if applicable.
EndedAt *time.Time `json:"ended_at,omitempty"`
}
Poll represents a Twitch poll on a channel.
type PollChoice ¶ added in v0.4.0
type PollChoice struct {
// ID is the ID that uniquely identifies the choice.
ID string `json:"id"`
// Title is the title of the choice.
Title string `json:"title"`
// Votes is the number of votes the choice has received.
Votes int `json:"votes"`
// ChannelPointsVotes is the number of channel points votes the choice has received.
ChannelPointsVotes int `json:"channel_points_votes"`
// BitsVotes is the number of bits votes the choice has received.
BitsVotes int `json:"bits_votes"`
}
PollChoice represents a choice in a Twitch poll.
type PollsInsertCall ¶ added in v0.4.0
type PollsInsertCall struct {
// contains filtered or unexported fields
}
PollsInsertCall represents a POST call to a Twitch Polls API endpoint.
func (*PollsInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *PollsInsertCall) BroadcasterID(broadcasterID string) *PollsInsertCall
BroadcasterID sets the BroadcasterID body parameter.
func (*PollsInsertCall) ChannelPointsPerVote ¶ added in v0.4.0
func (api *PollsInsertCall) ChannelPointsPerVote(channelPointsPerVote int) *PollsInsertCall
ChannelPointsPerVote sets the ChannelPointsPerVote body parameter.
func (*PollsInsertCall) ChannelPointsVotingEnabled ¶ added in v0.4.0
func (api *PollsInsertCall) ChannelPointsVotingEnabled(channelPointsVotingEnabled bool) *PollsInsertCall
ChannelPointsVotingEnabled sets the ChannelPointsVotingEnabled body parameter.
func (*PollsInsertCall) Choices ¶ added in v0.4.0
func (api *PollsInsertCall) Choices(choicess ...OutboundChoice) *PollsInsertCall
Choices sets the Choices body parameter.
func (*PollsInsertCall) Do ¶ added in v0.4.0
func (api *PollsInsertCall) Do(ctx context.Context, opts ...RequestOption) (*PollsInsertResponse, error)
Do executes the request.
func (*PollsInsertCall) Duration ¶ added in v0.4.0
func (api *PollsInsertCall) Duration(duration int) *PollsInsertCall
Duration sets the Duration body parameter.
func (*PollsInsertCall) Title ¶ added in v0.4.0
func (api *PollsInsertCall) Title(title string) *PollsInsertCall
Title sets the Title body parameter.
type PollsInsertResponse ¶ added in v0.4.0
type PollsInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Poll data returned by the Twitch API.
Data []Poll
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
PollsInsertResponse represents the response from a POST request to /helix/polls.
type PollsListCall ¶ added in v0.4.0
type PollsListCall struct {
// contains filtered or unexported fields
}
PollsListCall represents a GET call to a Twitch Polls API endpoint.
func (*PollsListCall) After ¶ added in v0.4.0
func (api *PollsListCall) After(after string) *PollsListCall
After sets the After query parameter.
func (*PollsListCall) BroadcasterID ¶ added in v0.4.0
func (api *PollsListCall) BroadcasterID(broadcasterID string) *PollsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*PollsListCall) Do ¶ added in v0.4.0
func (api *PollsListCall) Do(ctx context.Context, opts ...RequestOption) (*PollsListResponse, error)
Do executes the request.
func (*PollsListCall) First ¶ added in v0.4.0
func (api *PollsListCall) First(first int) *PollsListCall
First sets the First query parameter.
func (*PollsListCall) ID ¶ added in v0.4.0
func (api *PollsListCall) ID(ids ...string) *PollsListCall
ID adds to the ID query parameter.
type PollsListResponse ¶ added in v0.4.0
type PollsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Poll data returned by the Twitch API.
Data []Poll
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
PollsListResponse represents the response from a GET request to /helix/polls.
type PollsModifyCall ¶ added in v0.4.0
type PollsModifyCall struct {
// contains filtered or unexported fields
}
PollsModifyCall represents a PATCH call to a Twitch Polls API endpoint.
func (*PollsModifyCall) BroadcasterID ¶ added in v0.4.0
func (api *PollsModifyCall) BroadcasterID(broadcasterID string) *PollsModifyCall
BroadcasterID sets the BroadcasterID body parameter.
func (*PollsModifyCall) Do ¶ added in v0.4.0
func (api *PollsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*PollsModifyResponse, error)
Do executes the request.
func (*PollsModifyCall) ID ¶ added in v0.4.0
func (api *PollsModifyCall) ID(id string) *PollsModifyCall
ID sets the ID body parameter.
func (*PollsModifyCall) Status ¶ added in v0.4.0
func (api *PollsModifyCall) Status(status string) *PollsModifyCall
Status sets the Status body parameter.
type PollsModifyResponse ¶ added in v0.4.0
type PollsModifyResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Poll data returned by the Twitch API.
Data []Poll
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
PollsModifyResponse represents the response from a PATCH request to /helix/polls.
type PollsResource ¶
type PollsResource struct {
// contains filtered or unexported fields
}
PollsResource represents the Twitch Polls API.
func NewPollsResource ¶
func NewPollsResource(client *Client) *PollsResource
NewPollsResource creates a new PollsResource.
func (*PollsResource) Insert ¶ added in v0.4.0
func (r *PollsResource) Insert(broadcasterID string, title string, duration int) *PollsInsertCall
Insert creates a new POST request to /helix/polls.
Creates a poll that viewers in the broadcaster's channel can vote on.
The poll begins as soon as it's created. You may run only one poll at a time.
Authorization ¶
Requires a user access token that includes the channel:manage:polls scope.
Check the Official Twitch Documentation for more information.
func (*PollsResource) List ¶ added in v0.4.0
func (r *PollsResource) List(broadcasterID string) *PollsListCall
List creates a new GET request to /helix/polls.
Gets a list of polls that have been created in the past 90 days.
Authorization ¶
Requires a user access token that includes the channel:read:polls or channel:manage:polls scope.
Check the Official Twitch Documentation for more information.
func (*PollsResource) Modify ¶ added in v0.4.0
func (r *PollsResource) Modify(broadcasterID string, id string, status string) *PollsModifyCall
Modify creates a new PATCH request to /helix/polls.
Ends an active poll. You have the option to end it or end it and archive it.
Authorization ¶
Requires a user access token that includes the channel:manage:polls scope.
Check the Official Twitch Documentation for more information.
type Prediction ¶ added in v0.4.0
type Prediction struct {
// ID is the ID that uniquely identifies the prediction.
ID string `json:"id"`
// BroadcasterID is the ID of the broadcaster that created the prediction.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that created the prediction.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that created the prediction.
BroadcasterName string `json:"broadcaster_name"`
// Title is the title of the prediction.
Title string `json:"title"`
// WinningOutcomeID is the ID of the winning outcome, if the prediction has been resolved.
WinningOutcomeID string `json:"winning_outcome_id,omitempty"`
// Status is the current status of the prediction.
Status string `json:"status"`
// PredictionWindowSeconds is the duration of the prediction in seconds.
PredictionWindowSeconds int `json:"prediction_window"`
// Outcomes is a list of possible outcomes for the prediction.
Outcomes []PredictionOutcome `json:"outcomes"`
// CreatedAt is the UTC timestamp of when the prediction was created.
CreatedAt time.Time `json:"created_at"`
// EndedAt is the UTC timestamp of when the prediction ended, if applicable.
EndedAt *time.Time `json:"ended_at,omitempty"`
// LockedAt is the UTC timestamp of when the prediction was locked, if applicable.
LockedAt *time.Time `json:"locked_at,omitempty"`
}
Prediction represents a Twitch prediction on a channel.
type PredictionOutcome ¶ added in v0.4.0
type PredictionOutcome struct {
// ID is the ID that uniquely identifies the outcome.
ID string `json:"id"`
// Title is the title of the outcome.
Title string `json:"title"`
// Color is the color associated with the outcome.
Color string `json:"color"`
// Users is the number of users who voted for the outcome.
Users int `json:"users"`
// ChannelPoints is the total number of channel points wagered on the outcome.
ChannelPoints int `json:"channel_points"`
// TopPredictors is a list of the top predictors for the outcome.
TopPredictors []PredictionParticipant `json:"top_predictors"`
}
PredictionOutcome represents an outcome in a Twitch prediction.
type PredictionParticipant ¶ added in v0.4.0
type PredictionParticipant struct {
// UserID is the ID of the user who participated in the prediction.
UserID string `json:"user_id"`
// UserLogin is the login name of the user who participated in the prediction.
UserLogin string `json:"user_login"`
// UserName is the display name of the user who participated in the prediction.
UserName string `json:"user_name"`
// ChannelPointsUsed is the number of channel points the user wagered.
ChannelPointsUsed int `json:"channel_points_used"`
// ChannelPointsWon is the number of channel points the user won, if applicable.
ChannelPointsWon int `json:"channel_points_won"`
}
PredictionParticipant represents a participant in a Twitch prediction.
type PredictionsInsertCall ¶ added in v0.4.0
type PredictionsInsertCall struct {
// contains filtered or unexported fields
}
PredictionsInsertCall represents a POST call to a Twitch Predictions API endpoint.
func (*PredictionsInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *PredictionsInsertCall) BroadcasterID(broadcasterID string) *PredictionsInsertCall
BroadcasterID sets the BroadcasterID body parameter.
func (*PredictionsInsertCall) Do ¶ added in v0.4.0
func (api *PredictionsInsertCall) Do(ctx context.Context, opts ...RequestOption) (*PredictionsInsertResponse, error)
Do executes the request.
func (*PredictionsInsertCall) Outcome ¶ added in v0.4.0
func (api *PredictionsInsertCall) Outcome(outcomes ...OutboundChoice) *PredictionsInsertCall
Outcome sets the Outcome body parameter.
func (*PredictionsInsertCall) PredictionWindow ¶ added in v0.4.0
func (api *PredictionsInsertCall) PredictionWindow(predictionWindow int) *PredictionsInsertCall
PredictionWindow sets the PredictionWindow body parameter.
func (*PredictionsInsertCall) Title ¶ added in v0.4.0
func (api *PredictionsInsertCall) Title(title string) *PredictionsInsertCall
Title sets the Title body parameter.
type PredictionsInsertResponse ¶ added in v0.4.0
type PredictionsInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Prediction data returned by the Twitch API.
Data []Prediction
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
PredictionsInsertResponse represents the response from a POST request to /helix/predictions.
type PredictionsListCall ¶ added in v0.4.0
type PredictionsListCall struct {
// contains filtered or unexported fields
}
PredictionsListCall represents a GET call to a Twitch Predictions API endpoint.
func (*PredictionsListCall) After ¶ added in v0.4.0
func (api *PredictionsListCall) After(after string) *PredictionsListCall
After sets the After query parameter.
func (*PredictionsListCall) BroadcasterID ¶ added in v0.4.0
func (api *PredictionsListCall) BroadcasterID(broadcasterID string) *PredictionsListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*PredictionsListCall) Do ¶ added in v0.4.0
func (api *PredictionsListCall) Do(ctx context.Context, opts ...RequestOption) (*PredictionsListResponse, error)
Do executes the request.
func (*PredictionsListCall) First ¶ added in v0.4.0
func (api *PredictionsListCall) First(first int) *PredictionsListCall
First sets the First query parameter.
func (*PredictionsListCall) ID ¶ added in v0.4.0
func (api *PredictionsListCall) ID(ids ...string) *PredictionsListCall
ID adds to the ID query parameter.
type PredictionsListResponse ¶ added in v0.4.0
type PredictionsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Prediction data returned by the Twitch API.
Data []Prediction
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
PredictionsListResponse represents the response from a GET request to /helix/predictions.
type PredictionsModifyCall ¶ added in v0.4.0
type PredictionsModifyCall struct {
// contains filtered or unexported fields
}
PredictionsModifyCall represents a PATCH call to a Twitch Predictions API endpoint.
func (*PredictionsModifyCall) BroadcasterID ¶ added in v0.4.0
func (api *PredictionsModifyCall) BroadcasterID(broadcasterID string) *PredictionsModifyCall
BroadcasterID sets the BroadcasterID body parameter.
func (*PredictionsModifyCall) Do ¶ added in v0.4.0
func (api *PredictionsModifyCall) Do(ctx context.Context, opts ...RequestOption) (*PredictionsModifyResponse, error)
Do executes the request.
func (*PredictionsModifyCall) ID ¶ added in v0.4.0
func (api *PredictionsModifyCall) ID(id string) *PredictionsModifyCall
ID sets the ID body parameter.
func (*PredictionsModifyCall) Status ¶ added in v0.4.0
func (api *PredictionsModifyCall) Status(status string) *PredictionsModifyCall
Status sets the Status body parameter.
func (*PredictionsModifyCall) WinningOutcomeID ¶ added in v0.4.0
func (api *PredictionsModifyCall) WinningOutcomeID(winningOutcomeID string) *PredictionsModifyCall
WinningOutcomeID sets the WinningOutcomeID body parameter.
type PredictionsModifyResponse ¶ added in v0.4.0
type PredictionsModifyResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Prediction data returned by the Twitch API.
Data []Prediction
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
PredictionsModifyResponse represents the response from a PATCH request to /helix/predictions.
type PredictionsResource ¶
type PredictionsResource struct {
// contains filtered or unexported fields
}
PredictionsResource represents the Twitch Predictions API.
func NewPredictionsResource ¶
func NewPredictionsResource(client *Client) *PredictionsResource
NewPredictionsResource creates a new PredictionsResource.
func (*PredictionsResource) Insert ¶ added in v0.4.0
func (r *PredictionsResource) Insert(broadcasterID string, title string, predictionWindow int) *PredictionsInsertCall
Insert creates a new POST request to /helix/predictions.
Creates a Channel Points Prediction.
With a Channel Points Prediction, the broadcaster poses a question and viewers try to predict the outcome. The prediction runs as soon as it's created. The broadcaster may run only one prediction at a time.
Authorization ¶
Requires a user access token that includes the channel:manage:predictions scope.
Check the Official Twitch Documentation for more information.
func (*PredictionsResource) List ¶ added in v0.4.0
func (r *PredictionsResource) List(broadcasterID string) *PredictionsListCall
List creates a new GET request to /helix/predictions.
Gets a list of Channel Points Predictions that the broadcaster created.
Authorization ¶
Requires a user access token that includes the channel:read:predictions or channel:manage:predictions scope.
Check the Official Twitch Documentation for more information.
func (*PredictionsResource) Modify ¶ added in v0.4.0
func (r *PredictionsResource) Modify(broadcasterID string, id string, status string) *PredictionsModifyCall
Modify creates a new PATCH request to /helix/predictions.
Locks, resolves, or cancels a Channel Points Prediction.
Authorization ¶
Requires a user access token that includes the channel:manage:predictions scope.
Check the Official Twitch Documentation for more information.
type RaidDeleteCall ¶ added in v0.4.0
type RaidDeleteCall struct {
// contains filtered or unexported fields
}
RaidDeleteCall represents a DELETE call to a Twitch Raids API endpoint.
func (*RaidDeleteCall) BroadcasterID ¶ added in v0.4.0
func (api *RaidDeleteCall) BroadcasterID(broadcasterID string) *RaidDeleteCall
BroadcasterID sets the BroadcasterID query parameter.
func (*RaidDeleteCall) Do ¶ added in v0.4.0
func (api *RaidDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*RaidDeleteResponse, error)
Do executes the request.
type RaidDeleteResponse ¶ added in v0.4.0
type RaidDeleteResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
RaidDeleteResponse represents the response from a DELETE request to /helix/raids.
type RaidInsertCall ¶ added in v0.4.0
type RaidInsertCall struct {
// contains filtered or unexported fields
}
RaidInsertCall represents a POST call to a Twitch Raids API endpoint.
func (*RaidInsertCall) Do ¶ added in v0.4.0
func (api *RaidInsertCall) Do(ctx context.Context, opts ...RequestOption) (*RaidInsertResponse, error)
Do executes the request.
func (*RaidInsertCall) FromBroadcasterID ¶ added in v0.4.0
func (api *RaidInsertCall) FromBroadcasterID(fromBroadcasterID string) *RaidInsertCall
FromBroadcasterID sets the FromBroadcasterID body parameter.
func (*RaidInsertCall) ToBroadcasterID ¶ added in v0.4.0
func (api *RaidInsertCall) ToBroadcasterID(toBroadcasterID string) *RaidInsertCall
ToBroadcasterID sets the ToBroadcasterID body parameter.
type RaidInsertResponse ¶ added in v0.4.0
type RaidInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the InitializedRaid data returned by the Twitch API.
Data []InitializedRaid
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
RaidInsertResponse represents the response from a POST request to /helix/raids.
type RaidsResource ¶
type RaidsResource struct {
// contains filtered or unexported fields
}
RaidsResource represents the Twitch Raids API.
func NewRaidsResource ¶
func NewRaidsResource(client *Client) *RaidsResource
NewRaidsResource creates a new RaidsResource.
func (*RaidsResource) Delete ¶ added in v0.4.0
func (r *RaidsResource) Delete(broadcasterID string) *RaidDeleteCall
Delete creates a new DELETE request to /helix/raids.
Cancels a pending raid that was initiated by the broadcaster.
You can cancel a raid at any point up until the broadcaster clicks Raid Now in the Twitch UX or the 90-second countdown expires.
Rate Limit ¶
The limit is 10 requests within a 10-minute window.
Authorization ¶
Requires a user access token that includes the channel:manage:raids scope.
Check the Official Twitch Documentation for more information.
func (*RaidsResource) Insert ¶ added in v0.4.0
func (r *RaidsResource) Insert(fromBroadcasterID string, toBroadcasterID string) *RaidInsertCall
Insert creates a new POST request to /helix/raids.
Raid another channel by sending the broadcaster's viewers to the targeted channel.
When you call the API from a chat bot or extension, the Twitch UX pops up a window at the top of the chat room that identifies the number of viewers in the raid. The raid occurs when the broadcaster clicks Raid Now or after the 90-second countdown expires.
Rate Limit ¶
The limit is 10 requests within a 10-minute window.
Authorization ¶
Requires a user access token that includes the channel:manage:raids scope.
Check the Official Twitch Documentation for more information.
type RedemptionRewardInfo ¶ added in v0.4.0
type RedemptionRewardInfo struct {
// RewardID is the ID of the custom reward.
RewardID string `json:"id"`
// Title is the title of the custom reward.
Title string `json:"title"`
// Prompt is the prompt of the custom reward.
Prompt string `json:"prompt"`
// Cost is the cost of the custom reward.
Cost int64 `json:"cost"`
}
RedemptionRewardInfo represents basic reward info for a custom reward redemption.
type RequestOption ¶
RequestOption is a function that modifies an HTTP request.
func AddHeader ¶ added in v0.4.0
func AddHeader[T any](key string, value T) RequestOption
AddHeader adds a header to the request without replacing any existing values.
func AddQueryParameter ¶
func AddQueryParameter[T any](key string, value T) RequestOption
AddQueryParameter adds a query parameter to the request without replacing any existing values.
func SetHeader ¶ added in v0.4.0
func SetHeader[T any](key string, value T) RequestOption
SetHeader sets a header on the request, replacing any existing values.
func SetQueryParameter ¶
func SetQueryParameter[T any](key string, value T) RequestOption
SetQueryParameter sets a query parameter on the request, replacing any existing values.
func WithAuthorization ¶ added in v0.4.2
func WithAuthorization(authorization Authorization) RequestOption
WithAuthorization sets the authorization to use for the API request, usually a User Access Token.
func WithBearerToken ¶
func WithBearerToken(token string) RequestOption
WithBearerToken sets the bearer token to use for API requests.
type ResponseData ¶
type ResponseData[T any] struct { Total int `json:"total,omitempty"` // Only present in some endpoints. TotalCost int `json:"total_cost,omitempty"` // Only present in some endpoints. MaxCost int `json:"max_total_cost,omitempty"` // Only present in some endpoints. Points int `json:"points,omitempty"` // Only present in some endpoints. Data []T `json:"data"` Errors []ConduitError `json:"errors,omitempty"` Template string `json:"template,omitempty"` DateRange DateRange `json:"date_range,omitempty"` Pagination Pagination `json:"pagination,omitempty"` Status int `json:"status"` // If not provided by Twitch, defaults to HTTP status code. Code string `json:"error"` // If not provided by Twitch, defaults to HTTP status text. Message string `json:"message,omitempty"` // Only present if status is non-200 }
ResponseData represents a generic response from the Twitch API.
type ScheduleResource ¶
type ScheduleResource struct {
// contains filtered or unexported fields
}
ScheduleResource represents the Twitch Schedule API.
func NewScheduleResource ¶
func NewScheduleResource(client *Client) *ScheduleResource
NewScheduleResource creates a new ScheduleResource.
func (*ScheduleResource) List ¶ added in v0.4.0
func (r *ScheduleResource) List(broadcasterID string) *ChannelStreamScheduleListCall
List creates a new GET request to /helix/schedule.
Gets the broadcaster's streaming schedule. You can get the entire schedule or specific segments of the schedule.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type SearchCategoriesListCall ¶ added in v0.4.0
type SearchCategoriesListCall struct {
// contains filtered or unexported fields
}
SearchCategoriesListCall represents a GET call to a Twitch SearchCategories API endpoint.
func (*SearchCategoriesListCall) After ¶ added in v0.4.0
func (api *SearchCategoriesListCall) After(after string) *SearchCategoriesListCall
After sets the After query parameter.
func (*SearchCategoriesListCall) Do ¶ added in v0.4.0
func (api *SearchCategoriesListCall) Do(ctx context.Context, opts ...RequestOption) (*SearchCategoriesListResponse, error)
Do executes the request.
func (*SearchCategoriesListCall) First ¶ added in v0.4.0
func (api *SearchCategoriesListCall) First(first int) *SearchCategoriesListCall
First sets the First query parameter.
func (*SearchCategoriesListCall) Query ¶ added in v0.4.0
func (api *SearchCategoriesListCall) Query(query string) *SearchCategoriesListCall
Query sets the Query query parameter.
type SearchCategoriesListResponse ¶ added in v0.4.0
type SearchCategoriesListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the CategorySearchResult data returned by the Twitch API.
Data []CategorySearchResult
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
SearchCategoriesListResponse represents the response from a GET request to /helix/search/categories.
type SearchCategoriesResource ¶ added in v0.4.0
type SearchCategoriesResource struct {
// contains filtered or unexported fields
}
SearchCategoriesResource represents the Twitch SearchCategories API.
func NewSearchCategoriesResource ¶ added in v0.4.0
func NewSearchCategoriesResource(client *Client) *SearchCategoriesResource
NewSearchCategoriesResource creates a new SearchCategoriesResource.
func (*SearchCategoriesResource) List ¶ added in v0.4.0
func (r *SearchCategoriesResource) List(query string) *SearchCategoriesListCall
List creates a new GET request to /helix/search/categories.
Gets the games or categories that match the specified query.
To match, the category's name must contain all parts of the query string. For example, if the query string is 42, the response includes any category name that contains 42 in the title. If the query string is a phrase like love computer, the response includes any category name that contains the words love and computer anywhere in the name. The comparison is case insensitive.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type SearchChannelsListCall ¶ added in v0.4.0
type SearchChannelsListCall struct {
// contains filtered or unexported fields
}
SearchChannelsListCall represents a GET call to a Twitch SearchChannels API endpoint.
func (*SearchChannelsListCall) After ¶ added in v0.4.0
func (api *SearchChannelsListCall) After(after string) *SearchChannelsListCall
After sets the After query parameter.
func (*SearchChannelsListCall) Do ¶ added in v0.4.0
func (api *SearchChannelsListCall) Do(ctx context.Context, opts ...RequestOption) (*SearchChannelsListResponse, error)
Do executes the request.
func (*SearchChannelsListCall) First ¶ added in v0.4.0
func (api *SearchChannelsListCall) First(first int) *SearchChannelsListCall
First sets the First query parameter.
func (*SearchChannelsListCall) LiveOnly ¶ added in v0.4.0
func (api *SearchChannelsListCall) LiveOnly(liveOnly bool) *SearchChannelsListCall
LiveOnly sets the LiveOnly query parameter.
func (*SearchChannelsListCall) Query ¶ added in v0.4.0
func (api *SearchChannelsListCall) Query(query string) *SearchChannelsListCall
Query sets the Query query parameter.
type SearchChannelsListResponse ¶ added in v0.4.0
type SearchChannelsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the ChannelSearchResult data returned by the Twitch API.
Data []ChannelSearchResult
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
SearchChannelsListResponse represents the response from a GET request to /helix/search/channels.
type SearchChannelsResource ¶ added in v0.4.0
type SearchChannelsResource struct {
// contains filtered or unexported fields
}
SearchChannelsResource represents the Twitch SearchChannels API.
func NewSearchChannelsResource ¶ added in v0.4.0
func NewSearchChannelsResource(client *Client) *SearchChannelsResource
NewSearchChannelsResource creates a new SearchChannelsResource.
func (*SearchChannelsResource) List ¶ added in v0.4.0
func (r *SearchChannelsResource) List(query string) *SearchChannelsListCall
List creates a new GET request to /helix/search/channels.
Gets the channels that match the specified query and have streamed content within the past 6 months.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type SearchResource ¶
type SearchResource struct {
// Categories provides access to the Twitch Categories API.
Categories *SearchCategoriesResource
// Channels provides access to the Twitch Channels API.
Channels *SearchChannelsResource
// contains filtered or unexported fields
}
SearchResource represents the Twitch Search API.
func NewSearchResource ¶
func NewSearchResource(client *Client) *SearchResource
NewSearchResource creates a new SearchResource.
type SendMessageInsertCall ¶ added in v0.4.0
type SendMessageInsertCall struct {
// contains filtered or unexported fields
}
SendMessageInsertCall represents a POST call to a Twitch Chat API endpoint.
func (*SendMessageInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *SendMessageInsertCall) BroadcasterID(broadcasterID string) *SendMessageInsertCall
BroadcasterID sets the BroadcasterID body parameter.
func (*SendMessageInsertCall) Do ¶ added in v0.4.0
func (api *SendMessageInsertCall) Do(ctx context.Context, opts ...RequestOption) (*SendMessageInsertResponse, error)
Do executes the request.
func (*SendMessageInsertCall) ForSourceOnly ¶ added in v0.4.0
func (api *SendMessageInsertCall) ForSourceOnly(forSourceOnly bool) *SendMessageInsertCall
ForSourceOnly sets the ForSourceOnly body parameter.
func (*SendMessageInsertCall) Message ¶ added in v0.4.0
func (api *SendMessageInsertCall) Message(message string) *SendMessageInsertCall
Message sets the Message body parameter.
func (*SendMessageInsertCall) ReplayParentMessageID ¶ added in v0.4.0
func (api *SendMessageInsertCall) ReplayParentMessageID(replayParentMessageID string) *SendMessageInsertCall
ReplayParentMessageID sets the ReplayParentMessageID body parameter.
func (*SendMessageInsertCall) SenderID ¶ added in v0.4.0
func (api *SendMessageInsertCall) SenderID(senderID string) *SendMessageInsertCall
SenderID sets the SenderID body parameter.
type SendMessageInsertResponse ¶ added in v0.4.0
type SendMessageInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the OutboundChatMessage data returned by the Twitch API.
Data []OutboundChatMessage
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
SendMessageInsertResponse represents the response from a POST request to /helix/chat/messages.
type SendWhisperInsertCall ¶ added in v0.4.0
type SendWhisperInsertCall struct {
// contains filtered or unexported fields
}
SendWhisperInsertCall represents a POST call to a Twitch Whispers API endpoint.
func (*SendWhisperInsertCall) Do ¶ added in v0.4.0
func (api *SendWhisperInsertCall) Do(ctx context.Context, opts ...RequestOption) (*SendWhisperInsertResponse, error)
Do executes the request.
func (*SendWhisperInsertCall) FromUserID ¶ added in v0.4.0
func (api *SendWhisperInsertCall) FromUserID(fromUserID string) *SendWhisperInsertCall
FromUserID sets the FromUserID query parameter.
func (*SendWhisperInsertCall) Message ¶ added in v0.4.0
func (api *SendWhisperInsertCall) Message(message string) *SendWhisperInsertCall
Message sets the Message body parameter.
func (*SendWhisperInsertCall) ToUserID ¶ added in v0.4.0
func (api *SendWhisperInsertCall) ToUserID(toUserID string) *SendWhisperInsertCall
ToUserID sets the ToUserID query parameter.
type SendWhisperInsertResponse ¶ added in v0.4.0
type SendWhisperInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
SendWhisperInsertResponse represents the response from a POST request to /helix/whispers.
type SharedChatSession ¶ added in v0.4.0
type SharedChatSession struct {
SessionID string `json:"session_id"`
HostBroadcasterID string `json:"host_broadcaster_id"`
Participants []SharedChatSessionParticipant `json:"participants"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
SharedChatSession represents a shared chat session.
type SharedChatSessionListCall ¶ added in v0.4.0
type SharedChatSessionListCall struct {
// contains filtered or unexported fields
}
SharedChatSessionListCall represents a GET call to a Twitch ChatShared API endpoint.
func (*SharedChatSessionListCall) BroadcasterID ¶ added in v0.4.0
func (api *SharedChatSessionListCall) BroadcasterID(broadcasterID string) *SharedChatSessionListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*SharedChatSessionListCall) Do ¶ added in v0.4.0
func (api *SharedChatSessionListCall) Do(ctx context.Context, opts ...RequestOption) (*SharedChatSessionListResponse, error)
Do executes the request.
type SharedChatSessionListResponse ¶ added in v0.4.0
type SharedChatSessionListResponse struct {
Status string
StatusCode int
Header http.Header
Data []SharedChatSession
Request *http.Request
}
SharedChatSessionListResponse represents the response from a GET request to /helix/shared_chat/session.
type SharedChatSessionParticipant ¶ added in v0.4.0
type SharedChatSessionParticipant struct {
BroadcasterID string `json:"broadcaster_id"`
}
SharedChatSessionParticipant represents a participant in a shared chat session.
type ShieldModeStatus ¶ added in v0.4.0
type ShieldModeStatus struct {
// ModeratorID is the ID of the moderator that changed the Shield Mode status.
ModeratorID string `json:"moderator_id"`
// ModeratorLogin is the login name of the moderator that changed the Shield Mode status.
ModeratorLogin string `json:"moderator_login"`
// ModeratorName is the display name of the moderator that changed the Shield Mode status.
ModeratorName string `json:"moderator_name"`
// Active indicates whether Shield Mode is currently active on the channel.
Active bool `json:"is_active"`
// LastActivatedAt is the UTC timestamp of when Shield Mode was last activated.
LastActivatedAt time.Time `json:"last_activated_at"`
}
ShieldModeStatus represents the status of Shield Mode on a Twitch channel.
type SizedImage ¶ added in v0.4.0
type SizedImage struct {
// Size1x is the URL to the 1x size image.
Size1x string `json:"url_1x"`
// Size2x is the URL to the 2x size image.
Size2x string `json:"url_2x"`
// Size4x is the URL to the 4x size image.
Size4x string `json:"url_4x"`
}
SizedImage represents an image with multiple sizes.
type SnoozeNextAdInsertCall ¶ added in v0.4.0
type SnoozeNextAdInsertCall struct {
// contains filtered or unexported fields
}
SnoozeNextAdInsertCall represents a POST call to a Twitch AdsSnooze API endpoint.
func (*SnoozeNextAdInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *SnoozeNextAdInsertCall) BroadcasterID(broadcasterID string) *SnoozeNextAdInsertCall
BroadcasterID sets the BroadcasterID query parameter.
func (*SnoozeNextAdInsertCall) Do ¶ added in v0.4.0
func (api *SnoozeNextAdInsertCall) Do(ctx context.Context, opts ...RequestOption) (*SnoozeNextAdInsertResponse, error)
Do executes the request.
type SnoozeNextAdInsertResponse ¶ added in v0.4.0
type SnoozeNextAdInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the AdsSnoozed data returned by the Twitch API.
Data []AdsSnoozed
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
SnoozeNextAdInsertResponse represents the response from a POST request to /helix/channels/ads/schedule/snooze.
type StartCommercialInsertCall ¶ added in v0.4.0
type StartCommercialInsertCall struct {
// contains filtered or unexported fields
}
StartCommercialInsertCall represents a POST call to a Twitch Ads API endpoint.
func (*StartCommercialInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *StartCommercialInsertCall) BroadcasterID(broadcasterID string) *StartCommercialInsertCall
BroadcasterID sets the BroadcasterID body parameter.
func (*StartCommercialInsertCall) Do ¶ added in v0.4.0
func (api *StartCommercialInsertCall) Do(ctx context.Context, opts ...RequestOption) (*StartCommercialInsertResponse, error)
Do executes the request.
func (*StartCommercialInsertCall) Length ¶ added in v0.4.0
func (api *StartCommercialInsertCall) Length(length int) *StartCommercialInsertCall
Length sets the Length body parameter.
type StartCommercialInsertResponse ¶ added in v0.4.0
type StartCommercialInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Commercial data returned by the Twitch API.
Data []Commercial
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
StartCommercialInsertResponse represents the response from a POST request to /helix/channels/commercial.
type Stream ¶
type Stream struct {
// ID is the ID that uniquely identifies the stream.
ID string `json:"id"`
// UserID is the ID of the user who is streaming.
UserID string `json:"user_id"`
// UserLogin is the login name of the user who is streaming.
UserLogin string `json:"user_login"`
// UserName is the display name of the user who is streaming.
UserName string `json:"user_name"`
// GameID is the ID of the game being played on the stream.
GameID string `json:"game_id"`
// GameName is the name of the game being played on the stream.
GameName string `json:"game_name"`
// Type is the type of the stream (e.g., "live").
Type string `json:"type"`
// Title is the title of the stream.
Title string `json:"title"`
// Language is the language of the stream.
Language string `json:"language"`
// ThumbnailURL is the URL to the thumbnail of the stream.
ThumbnailURL string `json:"thumbnail_url"`
// Tags is a list of tags associated with the stream.
Tags []string `json:"tags"`
// ViewerCount is the number of viewers currently watching the stream.
ViewerCount int `json:"viewer_count"`
// IsMature indicates whether the stream is marked as mature.
IsMature bool `json:"is_mature"`
// StartedAt is the UTC timestamp of when the stream started.
StartedAt time.Time `json:"started_at"`
}
Stream represents a Twitch stream.
type StreamKey ¶ added in v0.4.0
type StreamKey struct {
// StreamKey is the stream key to use in order to stream to Twitch.
//
// # This value is sensitive and should be treated like a password. Do not share it with anyone.
Key string `json:"stream_key"`
}
StreamKey represents a Twitch stream key.
type StreamKeyListCall ¶ added in v0.4.0
type StreamKeyListCall struct {
// contains filtered or unexported fields
}
StreamKeyListCall represents a GET call to a Twitch StreamsStreamKey API endpoint.
func (*StreamKeyListCall) BroadcasterID ¶ added in v0.4.0
func (api *StreamKeyListCall) BroadcasterID(broadcasterID string) *StreamKeyListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*StreamKeyListCall) Do ¶ added in v0.4.0
func (api *StreamKeyListCall) Do(ctx context.Context, opts ...RequestOption) (*StreamKeyListResponse, error)
Do executes the request.
type StreamKeyListResponse ¶ added in v0.4.0
type StreamKeyListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the StreamKey data returned by the Twitch API.
Data []StreamKey
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
StreamKeyListResponse represents the response from a GET request to /helix/streams/key.
type StreamMarker ¶ added in v0.4.0
type StreamMarker struct {
// UserID is the ID of the user who created the stream marker.
UserID string `json:"user_id"`
// UserLogin is the login name of the user who created the stream marker.
UserLogin string `json:"user_login"`
// UserName is the display name of the user who created the stream marker.
UserName string `json:"user_name"`
// Videos is a list of videos associated with the stream marker.
Videos []StreamMarkerVideo `json:"videos"`
}
StreamMarker represents a Twitch stream marker.
type StreamMarkerData ¶ added in v0.4.0
type StreamMarkerData struct {
// ID is the ID that uniquely identifies the stream marker.
ID string `json:"id"`
// Description is the description of the stream marker.
Description string `json:"description"`
// URL is the URL that opens the video in Twitch Highlighter
URL string `json:"url,omitempty"`
// PositionSeconds is the position of the stream marker in seconds from the start of the stream.
PositionSeconds int `json:"position_seconds"`
// CreatedAt is the UTC timestamp of when the stream marker was created.
CreatedAt time.Time `json:"created_at"`
}
StreamMarkerData represents a stream marker on a Twitch video.
type StreamMarkerInsertCall ¶ added in v0.4.0
type StreamMarkerInsertCall struct {
// contains filtered or unexported fields
}
StreamMarkerInsertCall represents a POST call to a Twitch StreamsMarkers API endpoint.
func (*StreamMarkerInsertCall) BroadcasterID ¶ added in v0.4.0
func (api *StreamMarkerInsertCall) BroadcasterID(broadcasterID string) *StreamMarkerInsertCall
BroadcasterID sets the BroadcasterID body parameter.
func (*StreamMarkerInsertCall) Description ¶ added in v0.4.0
func (api *StreamMarkerInsertCall) Description(description string) *StreamMarkerInsertCall
Description sets the Description body parameter.
func (*StreamMarkerInsertCall) Do ¶ added in v0.4.0
func (api *StreamMarkerInsertCall) Do(ctx context.Context, opts ...RequestOption) (*StreamMarkerInsertResponse, error)
Do executes the request.
type StreamMarkerInsertResponse ¶ added in v0.4.0
type StreamMarkerInsertResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the StreamMarkerData data returned by the Twitch API.
Data []StreamMarkerData
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
StreamMarkerInsertResponse represents the response from a POST request to /helix/streams/markers.
type StreamMarkerListCall ¶ added in v0.4.0
type StreamMarkerListCall struct {
// contains filtered or unexported fields
}
StreamMarkerListCall represents a GET call to a Twitch StreamsMarkers API endpoint.
func (*StreamMarkerListCall) After ¶ added in v0.4.0
func (api *StreamMarkerListCall) After(after string) *StreamMarkerListCall
After sets the After query parameter.
func (*StreamMarkerListCall) Before ¶ added in v0.4.0
func (api *StreamMarkerListCall) Before(before string) *StreamMarkerListCall
Before sets the Before query parameter.
func (*StreamMarkerListCall) BroadcasterID ¶ added in v0.4.0
func (api *StreamMarkerListCall) BroadcasterID(broadcasterID string) *StreamMarkerListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*StreamMarkerListCall) Do ¶ added in v0.4.0
func (api *StreamMarkerListCall) Do(ctx context.Context, opts ...RequestOption) (*StreamMarkerListResponse, error)
Do executes the request.
func (*StreamMarkerListCall) First ¶ added in v0.4.0
func (api *StreamMarkerListCall) First(first int) *StreamMarkerListCall
First sets the First query parameter.
func (*StreamMarkerListCall) VideoID ¶ added in v0.4.0
func (api *StreamMarkerListCall) VideoID(videoID string) *StreamMarkerListCall
VideoID sets the VideoID query parameter.
type StreamMarkerListResponse ¶ added in v0.4.0
type StreamMarkerListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the StreamMarker data returned by the Twitch API.
Data []StreamMarker
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
StreamMarkerListResponse represents the response from a GET request to /helix/streams/markers.
type StreamMarkerVideo ¶ added in v0.4.0
type StreamMarkerVideo struct {
// VideoID is the ID of the video.
VideoID string `json:"video_id"`
// Markers is a list of markers in the video.
Markers []StreamMarkerData `json:"markers"`
}
StreamMarkerVideo represents a video associated with a Twitch stream marker.
type StreamSchedule ¶ added in v0.4.0
type StreamSchedule struct {
// BroadcasterID is the ID of the broadcaster that the stream schedule belongs to.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that the stream schedule belongs to.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that the stream schedule belongs to.
BroadcasterName string `json:"broadcaster_name"`
// Vacation is the vacation period in the stream schedule, if applicable.
Vacation *StreamScheduleVacation `json:"vacation"`
// Segments is a list of segments in the stream schedule.
Segments []StreamScheduleSegment `json:"segments"`
}
StreamSchedule represents a Twitch stream schedule for a channel.
type StreamScheduleCategory ¶ added in v0.4.0
type StreamScheduleCategory struct {
// ID is the ID that uniquely identifies the category.
ID string `json:"id"`
// Name is the name of the category.
Name string `json:"name"`
}
StreamScheduleCategory represents a category in a Twitch stream schedule.
type StreamScheduleSegment ¶ added in v0.4.0
type StreamScheduleSegment struct {
// ID is the ID that uniquely identifies the segment.
ID string `json:"id"`
// Title is the title of the segment.
Title string `json:"title"`
// IsRecurring indicates whether the segment is recurring.
IsRecurring bool `json:"is_recurring"`
// Categories is a list of categories for the segment.
Categories []StreamScheduleCategory `json:"categories"`
// CanceledUntil is the UTC timestamp of when the segment is canceled until, if applicable.
CanceledUntil *time.Time `json:"canceled_until"`
// StartsAt is the UTC timestamp of when the segment starts.
StartsAt time.Time `json:"start_time"`
// EndsAt is the UTC timestamp of when the segment ends.
EndsAt time.Time `json:"end_time"`
}
StreamScheduleSegment represents a segment in a Twitch stream schedule.
type StreamScheduleVacation ¶ added in v0.4.0
type StreamScheduleVacation struct {
// StartsAt is the UTC timestamp of when the vacation starts.
StartsAt time.Time `json:"start_time"`
// EndsAt is the UTC timestamp of when the vacation ends.
EndsAt time.Time `json:"end_time"`
}
StreamScheduleVacation represents a vacation period in a Twitch stream schedule.
type StreamTag ¶ added in v0.4.0
type StreamTag struct {
// TagID is the ID that uniquely identifies the tag.
TagID string `json:"tag_id"`
// IsAutomatic indicates whether the tag was automatically applied by Twitch.
IsAutomatic bool `json:"is_auto"`
// LocalizedNames is a map of locale codes to localized tag names. The key is in the form, <locale>-<country/region>. For example, en-us.
LocalizedNames map[string]string `json:"localization_names,omitempty"`
// LocalizedDescriptions is a map of locale codes to localized tag descriptions. The key is in the form, <locale>-<country/region>. For example, en-us.
LocalizedDescriptions map[string]string `json:"localization_descriptions,omitempty"`
}
StreamTag represents a tag that can be associated with a Twitch stream.
type StreamsFollowedListCall ¶ added in v0.4.0
type StreamsFollowedListCall struct {
// contains filtered or unexported fields
}
StreamsFollowedListCall represents a GET call to a Twitch StreamsFollowed API endpoint.
func (*StreamsFollowedListCall) After ¶ added in v0.4.0
func (api *StreamsFollowedListCall) After(after string) *StreamsFollowedListCall
After sets the After query parameter.
func (*StreamsFollowedListCall) Do ¶ added in v0.4.0
func (api *StreamsFollowedListCall) Do(ctx context.Context, opts ...RequestOption) (*StreamsFollowedListResponse, error)
Do executes the request.
func (*StreamsFollowedListCall) First ¶ added in v0.4.0
func (api *StreamsFollowedListCall) First(first int) *StreamsFollowedListCall
First sets the First query parameter.
func (*StreamsFollowedListCall) UserID ¶ added in v0.4.0
func (api *StreamsFollowedListCall) UserID(userID string) *StreamsFollowedListCall
UserID sets the UserID query parameter.
type StreamsFollowedListResponse ¶ added in v0.4.0
type StreamsFollowedListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Stream data returned by the Twitch API.
Data []Stream
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
StreamsFollowedListResponse represents the response from a GET request to /helix/streams/followed.
type StreamsFollowedResource ¶ added in v0.4.0
type StreamsFollowedResource struct {
// contains filtered or unexported fields
}
StreamsFollowedResource represents the Twitch StreamsFollowed API.
func NewStreamsFollowedResource ¶ added in v0.4.0
func NewStreamsFollowedResource(client *Client) *StreamsFollowedResource
NewStreamsFollowedResource creates a new StreamsFollowedResource.
func (*StreamsFollowedResource) List ¶ added in v0.4.0
func (r *StreamsFollowedResource) List(userID string) *StreamsFollowedListCall
List creates a new GET request to /helix/streams/followed.
Gets the list of broadcasters that the user follows and that are streaming live.
Authorization ¶
Requires a user access token that includes the user:read:follows scope.
Check the Official Twitch Documentation for more information.
type StreamsListCall ¶
type StreamsListCall struct {
// contains filtered or unexported fields
}
StreamsListCall represents a GET call to a Twitch Streams API endpoint.
func (*StreamsListCall) After ¶
func (api *StreamsListCall) After(after string) *StreamsListCall
After sets the After query parameter.
func (*StreamsListCall) Before ¶
func (api *StreamsListCall) Before(before string) *StreamsListCall
Before sets the Before query parameter.
func (*StreamsListCall) Do ¶
func (api *StreamsListCall) Do(ctx context.Context, opts ...RequestOption) (*StreamsListResponse, error)
Do executes the request.
func (*StreamsListCall) First ¶
func (api *StreamsListCall) First(first int) *StreamsListCall
First sets the First query parameter.
func (*StreamsListCall) GameID ¶
func (api *StreamsListCall) GameID(gameIDs ...string) *StreamsListCall
GameID adds to the GameID query parameter.
func (*StreamsListCall) ID ¶ added in v0.4.0
func (api *StreamsListCall) ID(ids ...string) *StreamsListCall
ID adds to the ID query parameter.
func (*StreamsListCall) Language ¶ added in v0.4.0
func (api *StreamsListCall) Language(language string) *StreamsListCall
Language sets the Language query parameter.
func (*StreamsListCall) Period ¶ added in v0.4.0
func (api *StreamsListCall) Period(period string) *StreamsListCall
Period sets the Period query parameter.
func (*StreamsListCall) Type ¶
func (api *StreamsListCall) Type(t string) *StreamsListCall
Type sets the Type query parameter.
func (*StreamsListCall) UserID ¶
func (api *StreamsListCall) UserID(userIDs ...string) *StreamsListCall
UserID adds to the UserID query parameter.
type StreamsListResponse ¶
type StreamsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Stream data returned by the Twitch API.
Data []Stream
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
StreamsListResponse represents the response from a GET request to /helix/streams.
type StreamsMarkersResource ¶ added in v0.4.0
type StreamsMarkersResource struct {
// contains filtered or unexported fields
}
StreamsMarkersResource represents the Twitch StreamsMarkers API.
func NewStreamsMarkersResource ¶ added in v0.4.0
func NewStreamsMarkersResource(client *Client) *StreamsMarkersResource
NewStreamsMarkersResource creates a new StreamsMarkersResource.
func (*StreamsMarkersResource) Insert ¶ added in v0.4.0
func (r *StreamsMarkersResource) Insert(broadcasterID string) *StreamMarkerInsertCall
Insert creates a new POST request to /helix/streams/markers.
Creates a marker for a stream that is currently live.
Authorization ¶
Requires a user access token that includes the channel:manage:broadcast scope.
Check the Official Twitch Documentation for more information.
func (*StreamsMarkersResource) List ¶ added in v0.4.0
func (r *StreamsMarkersResource) List(broadcasterID string, videoID string) *StreamMarkerListCall
List creates a new GET request to /helix/streams/markers.
Gets a list of markers from the user's most recent stream or from the specified VOD/video.
A marker is an arbitrary point in a live stream that the broadcaster or editor marked, so they can return to that spot later to create video highlights (see Video Producer, Highlights in the Twitch UX).
Authorization ¶
Requires a user access token that includes the user:read:broadcast or channel:manage:broadcast scope.
Check the Official Twitch Documentation for more information.
type StreamsResource ¶
type StreamsResource struct {
// StreamKey provides access to the Twitch StreamKey API.
StreamKey *StreamsStreamKeyResource
// Followed provides access to the Twitch Followed API.
Followed *StreamsFollowedResource
// Markers provides access to the Twitch Markers API.
Markers *StreamsMarkersResource
// contains filtered or unexported fields
}
StreamsResource represents the Twitch Streams API.
func NewStreamsResource ¶
func NewStreamsResource(client *Client) *StreamsResource
NewStreamsResource creates a new StreamsResource.
func (*StreamsResource) List ¶
func (r *StreamsResource) List() *StreamsListCall
List creates a new GET request to /helix/streams.
Gets a list of all streams. The list is in descending order by the number of viewers watching the stream. Because viewers come and go during a stream, it's possible to find duplicate or missing streams in the list as you page through the results.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type StreamsStreamKeyResource ¶ added in v0.4.0
type StreamsStreamKeyResource struct {
// contains filtered or unexported fields
}
StreamsStreamKeyResource represents the Twitch StreamsStreamKey API.
func NewStreamsStreamKeyResource ¶ added in v0.4.0
func NewStreamsStreamKeyResource(client *Client) *StreamsStreamKeyResource
NewStreamsStreamKeyResource creates a new StreamsStreamKeyResource.
func (*StreamsStreamKeyResource) List ¶ added in v0.4.0
func (r *StreamsStreamKeyResource) List(broadcasterID string) *StreamKeyListCall
List creates a new GET request to /helix/streams/key.
Gets the channel's stream key.
Authorization ¶
Requires a user access token that includes the channel:read:stream_key scope.
Check the Official Twitch Documentation for more information.
type SubscriptionsResource ¶
type SubscriptionsResource struct {
// Subscribed provides access to the Twitch Subscribed API.
Subscribed *SubscriptionsSubscribedResource
// contains filtered or unexported fields
}
SubscriptionsResource represents the Twitch Subscriptions API.
func NewSubscriptionsResource ¶
func NewSubscriptionsResource(client *Client) *SubscriptionsResource
NewSubscriptionsResource creates a new SubscriptionsResource.
func (*SubscriptionsResource) List ¶ added in v0.4.0
func (r *SubscriptionsResource) List(broadcasterID string) *BroadcasterSubscriptionsListCall
List creates a new GET request to /helix/subscriptions.
Gets a list of users that subscribe to the specified broadcaster.
Authorization ¶
Requires a user access token that includes the channel:read:subscriptions scope.
A Twitch extensions may use an app access token if the broadcaster has granted the channel:read:subscriptions scope from within the Twitch Extensions manager.
Check the Official Twitch Documentation for more information.
type SubscriptionsSubscribedResource ¶ added in v0.4.0
type SubscriptionsSubscribedResource struct {
// contains filtered or unexported fields
}
SubscriptionsSubscribedResource represents the Twitch SubscriptionsSubscribed API.
func NewSubscriptionsSubscribedResource ¶ added in v0.4.0
func NewSubscriptionsSubscribedResource(client *Client) *SubscriptionsSubscribedResource
NewSubscriptionsSubscribedResource creates a new SubscriptionsSubscribedResource.
func (*SubscriptionsSubscribedResource) List ¶ added in v0.4.0
func (r *SubscriptionsSubscribedResource) List(broadcasterID string, userID string) *UserSubscriptionListCall
List creates a new GET request to /helix/subscriptions/user.
Checks whether the user subscribes to the broadcaster's channel.
Authorization ¶
Requires a user access token that includes the user:read:subscriptions scope.
A Twitch extensions may use an app access token if the broadcaster has granted the user:read:subscriptions scope from within the Twitch Extensions manager.
Check the Official Twitch Documentation for more information.
type Team ¶ added in v0.4.0
type Team struct {
// ID is the ID that uniquely identifies the team.
ID string `json:"id"`
// TeamName is the name of the team.
TeamName string `json:"team_name"`
// ThumbnailURL is the URL to the thumbnail of the team.
ThumbnailURL string `json:"thumbnail_url"`
// BackgroundImageURL is the URL to the background image of the team.
BackgroundImageURL string `json:"background_image_url"`
// Banner is the URL to the banner of the team.
Banner string `json:"banner"`
// Info is the description of the team.
Info string `json:"info"`
// Users is a list of users that are members of the team.
Users []UserInfo `json:"users"`
// CreatedAt is the UTC timestamp of when the team was created.
CreatedAt time.Time `json:"created_at"`
// UpdatedAt is the UTC timestamp of when the team was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
Team represents a Twitch team.
type TeamsChannelsResource ¶ added in v0.4.0
type TeamsChannelsResource struct {
// contains filtered or unexported fields
}
TeamsChannelsResource represents the Twitch TeamsChannels API.
func NewTeamsChannelsResource ¶ added in v0.4.0
func NewTeamsChannelsResource(client *Client) *TeamsChannelsResource
NewTeamsChannelsResource creates a new TeamsChannelsResource.
func (*TeamsChannelsResource) List ¶ added in v0.4.0
func (r *TeamsChannelsResource) List(broadcasterID string) *ChannelTeamsListCall
List creates a new GET request to /helix/teams/channel.
Gets the list of Twitch teams that the broadcaster is a member of.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type TeamsListCall ¶ added in v0.4.0
type TeamsListCall struct {
// contains filtered or unexported fields
}
TeamsListCall represents a GET call to a Twitch Teams API endpoint.
func (*TeamsListCall) Do ¶ added in v0.4.0
func (api *TeamsListCall) Do(ctx context.Context, opts ...RequestOption) (*TeamsListResponse, error)
Do executes the request.
func (*TeamsListCall) ID ¶ added in v0.4.0
func (api *TeamsListCall) ID(id string) *TeamsListCall
ID sets the ID query parameter.
func (*TeamsListCall) Name ¶ added in v0.4.0
func (api *TeamsListCall) Name(name string) *TeamsListCall
Name sets the Name query parameter.
type TeamsListResponse ¶ added in v0.4.0
type TeamsListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Team data returned by the Twitch API.
Data []Team
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
TeamsListResponse represents the response from a GET request to /helix/teams.
type TeamsResource ¶
type TeamsResource struct {
// Channels provides access to the Twitch Channels API.
Channels *TeamsChannelsResource
// contains filtered or unexported fields
}
TeamsResource represents the Twitch Teams API.
func NewTeamsResource ¶
func NewTeamsResource(client *Client) *TeamsResource
NewTeamsResource creates a new TeamsResource.
func (*TeamsResource) List ¶ added in v0.4.0
func (r *TeamsResource) List() *TeamsListCall
List creates a new GET request to /helix/teams.
Gets information about the specified Twitch team.
You are required to specify Name or ID as they are mutually exclusive.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type TopGamesListCall ¶
type TopGamesListCall struct {
// contains filtered or unexported fields
}
TopGamesListCall represents a GET call to a Twitch GamesTop API endpoint.
func (*TopGamesListCall) After ¶
func (api *TopGamesListCall) After(after string) *TopGamesListCall
After sets the After query parameter.
func (*TopGamesListCall) Before ¶
func (api *TopGamesListCall) Before(before string) *TopGamesListCall
Before sets the Before query parameter.
func (*TopGamesListCall) Do ¶
func (api *TopGamesListCall) Do(ctx context.Context, opts ...RequestOption) (*TopGamesListResponse, error)
Do executes the request.
func (*TopGamesListCall) First ¶
func (api *TopGamesListCall) First(first int) *TopGamesListCall
First sets the First query parameter.
type TopGamesListResponse ¶
type TopGamesListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Game data returned by the Twitch API.
Data []Game
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
TopGamesListResponse represents the response from a GET request to /helix/games/top.
type Transport ¶
type Transport struct {
// Method is the transport method. Possible values are "webhook" and "websocket".
Method string `json:"method"`
// Callback is the callback URL for webhook transports.
Callback string `json:"callback,omitempty"`
// Secret is the secret for webhook transports.
Secret string `json:"secret,omitempty"`
// SessionID is the session ID for websocket transports.
SessionID string `json:"session_id,omitempty"`
// ConnectedAt is the UTC timestamp of when the websocket transport connected.
ConnectedAt *time.Time `json:"connected_at,omitempty"`
// DisconnectedAt is the UTC timestamp of when the websocket transport disconnected.
DisconnectedAt *time.Time `json:"disconnected_at,omitempty"`
}
Transport is the transport method for a Twitch Eventsub Conduit Shard.
func WithWebSocketTransport ¶ added in v0.4.0
WithWebSocketTransport creates a new websocket transport for a Twitch Eventsub Conduit Shard.
func WithWebhookTransport ¶ added in v0.4.0
WithWebhookTransport creates a new webhook transport for a Twitch Eventsub Conduit Shard.
type TwitchAPIError ¶ added in v0.4.0
type TwitchAPIError struct {
Status int `json:"status"`
Code string `json:"error,omitempty"`
Message string `json:"message"`
}
TwitchAPIError represents an error returned by the Twitch API.
func (TwitchAPIError) Error ¶ added in v0.4.0
func (err TwitchAPIError) Error() string
type UnbanRequest ¶ added in v0.4.0
type UnbanRequest struct {
// ID is the ID that uniquely identifies the unban request.
ID string `json:"id"`
// BroadcasterID is the ID of the broadcaster that the unban request was sent to.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that the unban request was sent to.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that the unban request was sent to.
BroadcasterName string `json:"broadcaster_name"`
// ModeratorID is the ID of the moderator.
ModeratorID string `json:"moderator_id"`
// ModeratorLogin is the login name of the moderator.
ModeratorLogin string `json:"moderator_login"`
// ModeratorName is the display name of the moderator.
ModeratorName string `json:"moderator_name"`
// UserID is the ID of the user that sent the unban request.
UserID string `json:"user_id"`
// UserLogin is the login name of the user that sent the unban request.
UserLogin string `json:"user_login"`
// UserName is the display name of the user that sent the unban request.
UserName string `json:"user_name"`
// Text is the message from the user that sent the unban request.
Text string `json:"text"`
// Status is the status of the unban request.
Status string `json:"status"`
// ResolutionText is the message from the moderator that resolved the unban request.
ResolutionText string `json:"resolution_text,omitempty"`
// CreatedAt is the UTC timestamp of when the unban request was created.
CreatedAt time.Time `json:"created_at"`
// ResolvedAt is the UTC timestamp of when the unban request was resolved, if applicable.
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
}
UnbanRequest represents a users request to be unbanned from a Twitch channel.
type UnbanUserDeleteCall ¶ added in v0.4.0
type UnbanUserDeleteCall struct {
// contains filtered or unexported fields
}
UnbanUserDeleteCall represents a DELETE call to a Twitch ModerationBans API endpoint.
func (*UnbanUserDeleteCall) BroadcasterID ¶ added in v0.4.0
func (api *UnbanUserDeleteCall) BroadcasterID(broadcasterID string) *UnbanUserDeleteCall
BroadcasterID sets the BroadcasterID query parameter.
func (*UnbanUserDeleteCall) Do ¶ added in v0.4.0
func (api *UnbanUserDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*UnbanUserDeleteResponse, error)
Do executes the request.
func (*UnbanUserDeleteCall) ModeratorID ¶ added in v0.4.0
func (api *UnbanUserDeleteCall) ModeratorID(moderatorID string) *UnbanUserDeleteCall
ModeratorID sets the ModeratorID query parameter.
func (*UnbanUserDeleteCall) UserID ¶ added in v0.4.0
func (api *UnbanUserDeleteCall) UserID(userID string) *UnbanUserDeleteCall
UserID sets the UserID query parameter.
type UnbanUserDeleteResponse ¶ added in v0.4.0
type UnbanUserDeleteResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
UnbanUserDeleteResponse represents the response from a DELETE request to /helix/moderation/bans.
type UpdatedDropEntitlement ¶ added in v0.4.0
type UpdatedDropEntitlement struct {
// IDs is a list of IDs that were successfully updated.
IDs []string `json:"ids"`
// Status is the status of the update request.
Status string `json:"status"`
}
UpdatedDropEntitlement represents the result of an attempt to update drop entitlements.
type User ¶
type User struct {
// UserID is the ID of the user.
UserID string `json:"id"`
// UserLogin is the login name of the user.
UserLogin string `json:"login"`
// UserName is the display name of the user.
UserName string `json:"display_name"`
// Type is the type of user. Possible values are "staff", "admin", "global_mod", or "" (empty string) for regular users.
Type string `json:"type"`
// BroadcasterType is the broadcaster type of the user. Possible values are "partner", "affiliate", or "" (empty string) for regular users.
BroadcasterType string `json:"broadcaster_type"`
// Description is the description of the user.
Description string `json:"description"`
// ProfileImageURL is the URL to the profile image of the user.
ProfileImageURL string `json:"profile_image_url"`
// OfflineImageURL is the URL to the offline image of the user.
OfflineImageURL string `json:"offline_image_url"`
// Email is the email address of the user. This field is only included if app has the user:read:email scope for the user.
Email string `json:"email,omitempty"`
// CreatedAt is the UTC timestamp of when the user was created.
CreatedAt time.Time `json:"created_at"`
}
User represents a Twitch user.
type UserActiveExtension ¶ added in v0.4.0
type UserActiveExtension struct {
// Panel is a map of active panel extensions on the channel.
Panel map[string]UserActiveExtensionData `json:"panel"`
// Overlay is a map of active overlay extensions on the channel.
Overlay map[string]UserActiveExtensionData `json:"overlay"`
// Component is a map of active component extensions on the channel.
Component map[string]UserActiveExtensionPositionalData `json:"component"`
}
UserActiveExtension represents the active extensions on a Twitch channel.
type UserActiveExtensionData ¶ added in v0.4.0
type UserActiveExtensionData struct {
// ID is the ID that uniquely identifies the extension.
ID string `json:"id"`
// Name is the name of the extension.
Name string `json:"name"`
// Version is the version of the extension.
Version string `json:"version"`
// Active indicates whether the extension is active on the channel.
Active bool `json:"active"`
}
UserActiveExtensionData represents data about an active extension on a Twitch channel.
type UserActiveExtensionPositionalData ¶ added in v0.4.0
type UserActiveExtensionPositionalData struct {
// ID is the ID that uniquely identifies the extension.
ID string `json:"id"`
// Name is the name of the extension.
Name string `json:"name"`
// Version is the version of the extension.
Version string `json:"version"`
// X is the x position of the extension on the channel.
X int `json:"x"`
// Y is the y position of the extension on the channel.
Y int `json:"y"`
// Active indicates whether the extension is active on the channel.
Active bool `json:"active"`
}
UserActiveExtensionPositionalData represents data about an active extension on a Twitch channel.
type UserAuthorization ¶ added in v0.4.1
type UserAuthorization struct {
// UserID is the ID of the user.
UserID string `json:"user_id"`
// UserLogin is the login name of the user.
UserLogin string `json:"user_login"`
// UserName is the display name of the user.
UserName string `json:"user_name"`
// Scopes is a list of scopes that the user has granted to the application.
Scopes []string `json:"scopes"`
}
UserAuthorization represents the authorization information of a Twitch user.
type UserChatColor ¶ added in v0.4.0
type UserChatColor struct {
// UserID is the ID of the user.
UserID string `json:"user_id"`
// UserLogin is the login name of the user.
UserLogin string `json:"user_login"`
// UserName is the display name of the user.
UserName string `json:"user_name"`
// Color is the hex color code of the user's chat color.
Color string `json:"color"`
}
UserChatColor represents a user's chat color.
type UserChatColorListCall ¶ added in v0.4.0
type UserChatColorListCall struct {
// contains filtered or unexported fields
}
UserChatColorListCall represents a GET call to a Twitch ChatChattersUserColor API endpoint.
func (*UserChatColorListCall) Do ¶ added in v0.4.0
func (api *UserChatColorListCall) Do(ctx context.Context, opts ...RequestOption) (*UserChatColorListResponse, error)
Do executes the request.
func (*UserChatColorListCall) UserID ¶ added in v0.4.0
func (api *UserChatColorListCall) UserID(userIDs ...string) *UserChatColorListCall
UserID adds to the UserID query parameter.
type UserChatColorListResponse ¶ added in v0.4.0
type UserChatColorListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the UserChatColor data returned by the Twitch API.
Data []UserChatColor
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
UserChatColorListResponse represents the response from a GET request to /helix/chat/color.
type UserChatColorUpdateCall ¶ added in v0.4.0
type UserChatColorUpdateCall struct {
// contains filtered or unexported fields
}
UserChatColorUpdateCall represents a PUT call to a Twitch ChatChattersUserColor API endpoint.
func (*UserChatColorUpdateCall) Color ¶ added in v0.4.0
func (api *UserChatColorUpdateCall) Color(color string) *UserChatColorUpdateCall
Color sets the Color query parameter.
func (*UserChatColorUpdateCall) Do ¶ added in v0.4.0
func (api *UserChatColorUpdateCall) Do(ctx context.Context, opts ...RequestOption) (*UserChatColorUpdateResponse, error)
Do executes the request.
func (*UserChatColorUpdateCall) UserID ¶ added in v0.4.0
func (api *UserChatColorUpdateCall) UserID(userID string) *UserChatColorUpdateCall
UserID sets the UserID query parameter.
type UserChatColorUpdateResponse ¶ added in v0.4.0
type UserChatColorUpdateResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
UserChatColorUpdateResponse represents the response from a PUT request to /helix/chat/color.
type UserEmotesListCall ¶ added in v0.4.0
type UserEmotesListCall struct {
// contains filtered or unexported fields
}
UserEmotesListCall represents a GET call to a Twitch ChatEmotesUser API endpoint.
func (*UserEmotesListCall) After ¶ added in v0.4.0
func (api *UserEmotesListCall) After(after string) *UserEmotesListCall
After sets the After query parameter.
func (*UserEmotesListCall) BroadcasterID ¶ added in v0.4.0
func (api *UserEmotesListCall) BroadcasterID(broadcasterID string) *UserEmotesListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*UserEmotesListCall) Do ¶ added in v0.4.0
func (api *UserEmotesListCall) Do(ctx context.Context, opts ...RequestOption) (*UserEmotesListResponse, error)
Do executes the request.
func (*UserEmotesListCall) UserID ¶ added in v0.4.0
func (api *UserEmotesListCall) UserID(userID string) *UserEmotesListCall
UserID sets the UserID query parameter.
type UserEmotesListResponse ¶ added in v0.4.0
type UserEmotesListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Emote data returned by the Twitch API.
Data []Emote
// Template is the string data returned by the Twitch API.
Template string
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
UserEmotesListResponse represents the response from a GET request to /helix/chat/emotes/user.
type UserExtension ¶ added in v0.4.0
type UserExtension struct {
// ID is the ID that uniquely identifies the extension.
ID string `json:"id"`
// Name is the name of the extension.
Name string `json:"name"`
// Version is the version of the extension.
Version string `json:"version"`
// Type is the extension types that can be activated for this extension.
Types []string `json:"type"`
// CanActivate indicates whether the extension can be activated by the user.
CanActivate bool `json:"can_activate"`
}
UserExtension represents a Twitch user extension.
type UserInfo ¶ added in v0.4.0
type UserInfo struct {
// UserID is the ID of the user.
UserID string `json:"user_id"`
// UserLogin is the login name of the user.
UserLogin string `json:"user_login"`
// UserName is the display name of the user.
UserName string `json:"user_name"`
}
UserInfo represents basic information about a Twitch user.
type UserSubscriptionListCall ¶ added in v0.4.0
type UserSubscriptionListCall struct {
// contains filtered or unexported fields
}
UserSubscriptionListCall represents a GET call to a Twitch SubscriptionsSubscribed API endpoint.
func (*UserSubscriptionListCall) BroadcasterID ¶ added in v0.4.0
func (api *UserSubscriptionListCall) BroadcasterID(broadcasterID string) *UserSubscriptionListCall
BroadcasterID sets the BroadcasterID query parameter.
func (*UserSubscriptionListCall) Do ¶ added in v0.4.0
func (api *UserSubscriptionListCall) Do(ctx context.Context, opts ...RequestOption) (*UserSubscriptionListResponse, error)
Do executes the request.
func (*UserSubscriptionListCall) UserID ¶ added in v0.4.0
func (api *UserSubscriptionListCall) UserID(userID string) *UserSubscriptionListCall
UserID sets the UserID query parameter.
type UserSubscriptionListResponse ¶ added in v0.4.0
type UserSubscriptionListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the UserSubscriptionStatus data returned by the Twitch API.
Data []UserSubscriptionStatus
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
UserSubscriptionListResponse represents the response from a GET request to /helix/subscriptions/user.
type UserSubscriptionStatus ¶ added in v0.4.0
type UserSubscriptionStatus struct {
// BroadcasterID is the ID of the broadcaster that the subscription status belongs to.
BroadcasterID string `json:"broadcaster_id"`
// BroadcasterLogin is the login name of the broadcaster that the subscription status belongs to.
BroadcasterLogin string `json:"broadcaster_login"`
// BroadcasterName is the display name of the broadcaster that the subscription status belongs to.
BroadcasterName string `json:"broadcaster_name"`
// GifterID is the ID of the user that gifted the subscription, if applicable.
GifterID string `json:"gifter_id,omitempty"`
// GifterLogin is the login name of the user that gifted the subscription, if applicable.
GifterLogin string `json:"gifter_login,omitempty"`
// GifterName is the display name of the user that gifted the subscription, if applicable.
GifterName string `json:"gifter_name,omitempty"`
// Tier is the subscription tier.
Tier string `json:"tier"`
// IsGift indicates whether the subscription is a gift.
IsGift bool `json:"is_gift"`
}
UserSubscriptionStatus represents the subscription status of a user to a Twitch channel.
type UserWarning ¶ added in v0.4.0
type UserWarning struct {
// BroadcasterID is the ID of the channel in which the warning will take effect.
BroadcasterID string `json:"broadcaster_id"`
// ModeratorID is the ID of the moderator that issued the warning.
ModeratorID string `json:"moderator_id"`
// UserID is the ID of the user that was warned.
UserID string `json:"user_id"`
// Reason is the reason the user was warned.
Reason string `json:"reason"`
}
UserWarning represents a warning issued to a user on a Twitch channel.
type UsersAuthorizationResource ¶ added in v0.4.1
type UsersAuthorizationResource struct {
// contains filtered or unexported fields
}
UsersAuthorizationResource represents the Twitch UsersAuthorization API.
func NewUsersAuthorizationResource ¶ added in v0.4.1
func NewUsersAuthorizationResource(client *Client) *UsersAuthorizationResource
NewUsersAuthorizationResource creates a new UsersAuthorizationResource.
func (*UsersAuthorizationResource) List ¶ added in v0.4.1
func (r *UsersAuthorizationResource) List(userID string) *AuthorizationListCall
List creates a new GET request to /helix/authorization/users.
Gets the authorization scopes that the specified user(s) have granted the application.
Limits ¶
You may fetch the authorization information for a maximum of 10 users per request.
Authorization ¶
Requires a user access token.
Check the Official Twitch Documentation for more information.
type UsersListCall ¶
type UsersListCall struct {
// contains filtered or unexported fields
}
UsersListCall represents a GET call to a Twitch Users API endpoint.
func (*UsersListCall) Do ¶
func (api *UsersListCall) Do(ctx context.Context, opts ...RequestOption) (*UsersListResponse, error)
Do executes the request.
func (*UsersListCall) ID ¶
func (api *UsersListCall) ID(ids ...string) *UsersListCall
ID adds to the ID query parameter.
func (*UsersListCall) Login ¶
func (api *UsersListCall) Login(logins ...string) *UsersListCall
Login adds to the Login query parameter.
type UsersListResponse ¶
type UsersListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the User data returned by the Twitch API.
Data []User
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
UsersListResponse represents the response from a GET request to /helix/users.
type UsersResource ¶
type UsersResource struct {
// Authorization provides access to the Twitch Authorization API.
Authorization *UsersAuthorizationResource
// contains filtered or unexported fields
}
UsersResource represents the Twitch Users API.
func NewUsersResource ¶
func NewUsersResource(client *Client) *UsersResource
NewUsersResource creates a new UsersResource.
func (*UsersResource) List ¶
func (r *UsersResource) List() *UsersListCall
List creates a new GET request to /helix/users.
Gets information about one or more users. You may specify users by ID or by login name.
You may look up users using their user ID, login name, or both but the sum total of the number of users you may look up is 100. For example, you may specify 50 IDs and 50 names or 100 IDs or names, but you cannot specify 100 IDs and 100 names.
If you don't specify IDs or login names, the request returns information about the user in the access token if you specify a user access token.
Authorization ¶
Requires an app access token or user access token.
To include the user's verified email address in the response, you must use a user access token that includes the user:read:email scope.
Check the Official Twitch Documentation for more information.
type Video ¶
type Video struct {
// ID is the ID that uniquely identifies the video.
ID string `json:"id"`
// StreamID is the ID of the stream that the video is associated with.
StreamID string `json:"stream_id"`
// BroadcasterID is the ID of the user who created the video.
BroadcasterID string `json:"user_id"`
// BroadcasterLogin is the login name of the user who created the video.
BroadcasterLogin string `json:"user_login"`
// BroadcasterName is the display name of the user who created the video.
BroadcasterName string `json:"user_name"`
// Title is the title of the video.
Title string `json:"title"`
// Description is the description of the video.
Description string `json:"description"`
// URL is the URL to the video.
URL string `json:"url"`
// ThumbnailURL is the URL to the thumbnail of the video.
ThumbnailURL string `json:"thumbnail_url"`
// Viewable indicates the viewability of the video.
Viewable string `json:"viewable"`
// Language is the language of the video.
Language string `json:"language"`
// Type is the type of the video (e.g., "archive", "highlight", "upload").
Type string `json:"type"`
// Duration is the duration of the video.
Duration VideoDuration `json:"duration"`
// MutedSegments is a list of muted segments in the video.
MutedSegments []VideoMutedSegment `json:"muted_segments"`
// ViewCount is the number of views the video has received.
ViewCount int `json:"view_count"`
// PublishedAt is the UTC timestamp of when the video was published.
PublishedAt time.Time `json:"published_at"`
// CreatedAt is the UTC timestamp of when the video was created.
CreatedAt time.Time `json:"created_at"`
}
Video represents a Twitch video.
type VideoDuration ¶
VideoDuration represents the duration of a video.
func (VideoDuration) AsDuration ¶
func (d VideoDuration) AsDuration() time.Duration
AsDuration converts the VideoDuration to a time.Duration.
func (VideoDuration) MarshalJSON ¶ added in v0.4.0
func (d VideoDuration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*VideoDuration) UnmarshalJSON ¶
func (d *VideoDuration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type VideoMutedSegment ¶ added in v0.4.0
type VideoMutedSegment struct {
// Duration is the duration of the muted segment in seconds.
Duration int `json:"duration"`
// Offset is the offset of the muted segment in seconds from the start of the video.
Offset int `json:"offset"`
}
VideoMutedSegment represents a muted segment in a Twitch video.
type VideosDeleteCall ¶
type VideosDeleteCall struct {
// contains filtered or unexported fields
}
VideosDeleteCall represents a DELETE call to a Twitch Videos API endpoint.
func (*VideosDeleteCall) Do ¶
func (api *VideosDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*VideosDeleteResponse, error)
Do executes the request.
func (*VideosDeleteCall) ID ¶ added in v0.4.0
func (api *VideosDeleteCall) ID(id string) *VideosDeleteCall
ID sets the ID query parameter.
type VideosDeleteResponse ¶
type VideosDeleteResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
VideosDeleteResponse represents the response from a DELETE request to /helix/videos.
type VideosListCall ¶
type VideosListCall struct {
// contains filtered or unexported fields
}
VideosListCall represents a GET call to a Twitch Videos API endpoint.
func (*VideosListCall) After ¶
func (api *VideosListCall) After(after string) *VideosListCall
After sets the After query parameter.
func (*VideosListCall) Do ¶
func (api *VideosListCall) Do(ctx context.Context, opts ...RequestOption) (*VideosListResponse, error)
Do executes the request.
func (*VideosListCall) First ¶
func (api *VideosListCall) First(first int) *VideosListCall
First sets the First query parameter.
func (*VideosListCall) GameID ¶
func (api *VideosListCall) GameID(gameIDs ...string) *VideosListCall
GameID adds to the GameID query parameter.
func (*VideosListCall) ID ¶
func (api *VideosListCall) ID(ids ...string) *VideosListCall
ID adds to the ID query parameter.
func (*VideosListCall) Language ¶
func (api *VideosListCall) Language(language string) *VideosListCall
Language sets the Language query parameter.
func (*VideosListCall) Period ¶
func (api *VideosListCall) Period(period string) *VideosListCall
Period sets the Period query parameter.
func (*VideosListCall) Sort ¶
func (api *VideosListCall) Sort(sort string) *VideosListCall
Sort sets the Sort query parameter.
func (*VideosListCall) Type ¶
func (api *VideosListCall) Type(t string) *VideosListCall
Type sets the Type query parameter.
func (*VideosListCall) UserID ¶
func (api *VideosListCall) UserID(userIDs ...string) *VideosListCall
UserID adds to the UserID query parameter.
type VideosListResponse ¶
type VideosListResponse struct {
// Status is the HTTP status text returned by the Twitch API. For example, "200 OK".
Status string
// StatusCode is the HTTP status code returned by the Twitch API. For example, 200.
StatusCode int
// Header contains the HTTP headers from the Twitch API response.
Header http.Header
// Data is the Video data returned by the Twitch API.
Data []Video
// Pagination is the Pagination data returned by the Twitch API.
Pagination Pagination
// Request is the HTTP request that was sent to the Twitch API.
Request *http.Request
}
VideosListResponse represents the response from a GET request to /helix/videos.
type VideosResource ¶
type VideosResource struct {
// contains filtered or unexported fields
}
VideosResource represents the Twitch Videos API.
func NewVideosResource ¶
func NewVideosResource(client *Client) *VideosResource
NewVideosResource creates a new VideosResource.
func (*VideosResource) Delete ¶
func (r *VideosResource) Delete(id string) *VideosDeleteCall
Delete creates a new DELETE request to /helix/videos.
Deletes one or more videos. You may delete past broadcasts, highlights, or uploads.
Authorization ¶
Requires a user access token that includes the channel:manage:videos scope.
Check the Official Twitch Documentation for more information.
func (*VideosResource) List ¶
func (r *VideosResource) List() *VideosListCall
List creates a new GET request to /helix/videos.
Gets information about one or more published videos. You may get videos by ID, by user, or by game/category.
Authorization ¶
Requires an app access token or user access token.
Check the Official Twitch Documentation for more information.
type WhispersResource ¶
type WhispersResource struct {
// contains filtered or unexported fields
}
WhispersResource represents the Twitch Whispers API.
func NewWhispersResource ¶
func NewWhispersResource(client *Client) *WhispersResource
NewWhispersResource creates a new WhispersResource.
func (*WhispersResource) Insert ¶
func (r *WhispersResource) Insert(fromUserID string, toUserID string, message string) *SendWhisperInsertCall
Insert creates a new POST request to /helix/whispers.
Sends a whisper message to the specified user.
Rate Limits ¶
You may whisper to a maximum of 40 unique recipients per day. Within the per day limit, you may whisper a maximum of 3 whispers per second and a maximum of 100 whispers per minute.
Authorization ¶
The user sending the whisper must have a verified phone number (see the Phone Number setting in your Security and Privacy settings).
Requires a user access token that includes the user:manage:whispers scope.
Check the Official Twitch Documentation for more information.
Source Files
¶
- api_app_access.go
- api_endpoints.go
- api_response.go
- api_types.go
- api_user_token.go
- client.go
- options.go
- twitch_ads.go
- twitch_analytics.go
- twitch_bits.go
- twitch_channel_points.go
- twitch_channels.go
- twitch_charity.go
- twitch_chat.go
- twitch_clips.go
- twitch_conduits.go
- twitch_content_labels.go
- twitch_entitlements.go
- twitch_event_sub.go
- twitch_extensions.go
- twitch_games.go
- twitch_goals.go
- twitch_guest_star.go
- twitch_hype_train.go
- twitch_moderation.go
- twitch_polls.go
- twitch_predictions.go
- twitch_raids.go
- twitch_schedule.go
- twitch_search.go
- twitch_streams.go
- twitch_subscriptions.go
- twitch_teams.go
- twitch_users.go
- twitch_videos.go
- twitch_whispers.go