Versions in this module Expand all Collapse all v1 v1.0.1 Aug 3, 2026 Changes in this version + const ErrorDuplicate + const ErrorInvalidMessage + const ErrorMuted + const ErrorNeedBanReason + const ErrorNeedLogin + const ErrorNoPermission + const ErrorNotFound + const ErrorProtocol + const ErrorSubMode + const ErrorThorttled + const ErrorTooManyConnections + const FeatureAdministrator + const FeatureBirthday + const FeatureBot + const FeatureBot2 + const FeatureBroadcaster + const FeatureCompChallenge + const FeatureContributor + const FeatureEve + const FeatureModerator + const FeatureNotable + const FeatureProtected + const FeatureSC2 + const FeatureSubscriber + const FeatureTier1 + const FeatureTier2 + const FeatureTier3 + const FeatureTier4 + const FeatureTrusted + const FeatureTwitch + const FeatureVIP + var ErrAlreadyOpen = errors.New("web socket is already open") + var ErrReadOnly = errors.New("session is read-only") + var ErrTooManyArgs = errors.New("function called with unexcepted amount of arguments") + type Ban struct + Online bool + Sender User + Target User + Timestamp time.Time + type Broadcast struct + Message string + Sender User + Timestamp time.Time + UUID string + type Donation struct + Amount int64 + Audio string + Message string + Sender User + Timestamp time.Time + UUID string + type Message struct + Message string + Sender User + Timestamp time.Time + func (m *Message) IsAction() bool + type Mute struct + Online bool + Sender User + Target User + Timestamp time.Time + type Names struct + Connections int + Users []User + type Pin struct + Message string + Sender User + Timestamp time.Time + UUID string + type Ping struct + Timestamp int64 + type PrivateMessage struct + ID int + Message string + Timestamp time.Time + User User + type RoomAction struct + Timestamp time.Time + User User + type Session struct + func New(args ...string) (*Session, error) + func (s *Session) AddBanHandler(fn func(Ban, *Session)) + func (s *Session) AddBroadcastHandler(fn func(Broadcast, *Session)) + func (s *Session) AddDonationHandler(fn func(Donation, *Session)) + func (s *Session) AddErrorHandler(fn func(string, *Session)) + func (s *Session) AddJoinHandler(fn func(RoomAction, *Session)) + func (s *Session) AddMessageHandler(fn func(Message, *Session)) + func (s *Session) AddMuteHandler(fn func(Mute, *Session)) + func (s *Session) AddNamesHandler(fn func(Names, *Session)) + func (s *Session) AddPMHandler(fn func(PrivateMessage, *Session)) + func (s *Session) AddPinHandler(fn func(Pin, *Session)) + func (s *Session) AddPingHandler(fn func(Ping, *Session)) + func (s *Session) AddQuitHandler(fn func(RoomAction, *Session)) + func (s *Session) AddSocketErrorHandler(fn func(error, *Session)) + func (s *Session) AddSubOnlyHandler(fn func(SubOnly, *Session)) + func (s *Session) AddSubscriptionHandler(fn func(Subscription, *Session)) + func (s *Session) AddUnbanHandler(fn func(Ban, *Session)) + func (s *Session) AddUnmuteHandler(fn func(Mute, *Session)) + func (s *Session) AddUserUpdateHandler(fn func(User, *Session)) + func (s *Session) Close() error + func (s *Session) GetUser(name string) (User, bool) + func (s *Session) GetUsers() []User + func (s *Session) Open() error + func (s *Session) SendAction(message string) error + func (s *Session) SendBan(nick string, reason string, duration time.Duration, banip bool) error + func (s *Session) SendBroadcast(message string) error + func (s *Session) SendMessage(message string) error + func (s *Session) SendMute(nick string, duration time.Duration) error + func (s *Session) SendPermanentBan(nick string, reason string, banip bool) error + func (s *Session) SendPing() error + func (s *Session) SendPrivateMessage(nick string, message string) error + func (s *Session) SendSubOnly(subonly bool) error + func (s *Session) SendUnban(nick string) error + func (s *Session) SendUnmute(nick string) error + func (s *Session) SetDialer(d websocket.Dialer) + func (s *Session) SetURL(u url.URL) + type SubOnly struct + Active bool + Sender User + Timestamp time.Time + type SubTier struct + Label string + Tier int64 + type Subscription struct + Message string + Quantity int64 + Recipient User + Sender User + Tier SubTier + Timestamp time.Time + UUID string + func (s *Subscription) IsGift() bool + func (s *Subscription) IsMassGift() bool + type User struct + CreatedDate time.Time + Features []string + ID int64 + Nick string + Watching watching + func (u *User) HasFeature(s string) bool