Documentation ¶
Index ¶
- Variables
- type Config
- type Gateway
- func (b *Gateway) Ban(uid string) error
- func (b *Gateway) Channel() *gateway.Channel
- func (b *Gateway) ChannelUsers() []gateway.User
- func (b *Gateway) FindTrigger(s string) (bool, string, []string)
- func (b *Gateway) InitDefaultHandlers()
- func (b *Gateway) Kick(uid string) error
- func (b *Gateway) Operator() bool
- func (b *Gateway) Ping(uid string) (time.Duration, error)
- func (b *Gateway) Relay(ev *network.Event, from gateway.Gateway) error
- func (b *Gateway) Run(ctx context.Context) error
- func (b *Gateway) Say(s string) error
- func (b *Gateway) SayPrivate(uid string, s string) error
- func (b *Gateway) SetUserAccess(uid string, a gateway.AccessLevel) (*gateway.AccessLevel, error)
- func (b *Gateway) Unban(uid string) error
- func (b *Gateway) User(uid string) (*gateway.User, error)
- func (b *Gateway) Users() map[string]gateway.AccessLevel
- type GatewayConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSayBufferFull = errors.New("gw-capi: Say buffer full")
)
Errors
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { GatewayConfig chat.Config }
Config stores the configuration of a single CAPI connection
type Gateway ¶
type Gateway struct { gateway.Common *chat.Bot // Set once before Run(), read-only after that *GatewayConfig // contains filtered or unexported fields }
Gateway manages a CAPI connection
func (*Gateway) FindTrigger ¶
FindTrigger checks if s starts with trigger, returns cmd and args if true
func (*Gateway) InitDefaultHandlers ¶
func (b *Gateway) InitDefaultHandlers()
InitDefaultHandlers adds the default callbacks for relevant packets
func (*Gateway) SayPrivate ¶
SayPrivate sends a private chat message to uid
func (*Gateway) SetUserAccess ¶
func (b *Gateway) SetUserAccess(uid string, a gateway.AccessLevel) (*gateway.AccessLevel, error)
SetUserAccess overrides accesslevel for a specific user
type GatewayConfig ¶
type GatewayConfig struct { gateway.Config ReconnectDelay time.Duration BufSize uint8 AvatarDefaultURL string AccessWhisper gateway.AccessLevel AccessTalk gateway.AccessLevel AccessOperator gateway.AccessLevel AccessUser map[string]gateway.AccessLevel }
GatewayConfig stores the config additions of capi.Gateway over chat.Bot
Click to show internal directories.
Click to hide internal directories.