Documentation ¶
Overview ¶
Package twitch handles Twitch-specific logic.
Index ¶
- Constants
- Variables
- type Twitch
- func (t *Twitch) Channel(channel string) (*helix.ChannelInformation, error)
- func (t *Twitch) Connect(ctx context.Context) error
- func (t *Twitch) CurrentUsers() ([]string, error)
- func (t *Twitch) Disconnect() error
- func (t *Twitch) FetchUser(channel string) (*helix.User, error)
- func (t *Twitch) Join(channel string, prefix string) error
- func (t *Twitch) Leave(channel string) error
- func (t *Twitch) Listen() <-chan base.IncomingMessage
- func (t *Twitch) Name() string
- func (t *Twitch) Reply(msg base.Message, replyToID string) error
- func (t *Twitch) Send(msg base.Message) error
- func (t *Twitch) SetPrefix(channel, prefix string) error
- func (t *Twitch) Timeout(username, channel string, duration time.Duration) error
- func (t *Twitch) User(username string) (models.User, error)
- func (t *Twitch) Username() string
Constants ¶
View Source
const (
// Name is the unique, human-readable name of the platform.
Name = "Twitch"
)
Variables ¶
View Source
var ( ErrChannelNotFound = errors.New("channel not found") ErrBotIsBanned = errors.New("bot is banned from the channel") )
Functions ¶
This section is empty.
Types ¶
type Twitch ¶
type Twitch struct {
// contains filtered or unexported fields
}
Twitch implements Platform for a connection to Twitch chat.
func New ¶
func New(username string, owners []string, clientID, clientSecret, accessToken, refreshToken string, db *gorm.DB, cdb cache.Cache) *Twitch
New creates a new Twitch connection.
func NewForTesting ¶
New creates a new Twitch connection for testing.
func (*Twitch) CurrentUsers ¶
func (*Twitch) Disconnect ¶
func (*Twitch) Listen ¶
func (t *Twitch) Listen() <-chan base.IncomingMessage
Click to show internal directories.
Click to hide internal directories.