Documentation ¶
Index ¶
- type Client
- type Message
- type Option
- func As(mode modes.MessageRateMode) Option
- func Server(url *url.URL) Option
- func SetAuth(auth *TwitchAuthentication) Option
- func SetChannels(channel string, additionals ...string) Option
- func WithChannels(channels ...string) Option
- func WithCommands() Option
- func WithMembership() Option
- func WithTags() Option
- type TwitchAuthentication
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handling communication with twitch.
func New ¶
func New(auth *TwitchAuthentication, opts ...Option) *Client
New creates a new TwitchClient with default parameters applying the given options.
func (*Client) Connect ¶
func (client *Client) Connect(in <-chan *gbc.PlatformMessage) (<-chan *gbc.PlatformMessage, error)
Connect establishes an connection to twitch. Messages sent to the `in` channel are sent to twitch after messaging limits are applied. Returns a channel emitting messages received from twitch.
func (*Client) Disconnect ¶
func (client *Client) Disconnect()
Disconnect closes the connection to twitch.
type Message ¶
type Message gbc.PlatformMessage
Message sent from/to twitch.
type Option ¶
type Option func(client *Client)
Option to be applied to a client. Options are used for a good maintainable and fluid construction of twitch clients.
func SetAuth ¶
func SetAuth(auth *TwitchAuthentication) Option
SetAuth sets the Authentication used to connect to twitch.
func SetChannels ¶
SetChannels sets the channels to which the client should receive messages from.
func WithChannels ¶
WithChannels adds channels to the one noted in other options and the default ones.
func WithCommands ¶
func WithCommands() Option
WithCommands enables the client to request that the messages from twitch should contain commands.
func WithMembership ¶
func WithMembership() Option
WithMembership enables the client to request that the messages from twitch should contain membership information.
type TwitchAuthentication ¶
type TwitchAuthentication struct { // Username of the twitch account to login with. Username string // Token contains the OAuth token which can be obtained through https://twitchapps.com/tmi/. Token string }
TwitchAuthentication contains authentication information for twitch.