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) *gateway.Trigger
- 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-bnet: Say buffer full") ErrSayCommand = errors.New("gw-bnet: Say prevented execution of command") )
Errors
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { GatewayConfig bnet.Config }
Config stores the configuration of a single BNet server
type Gateway ¶
type Gateway struct { gateway.Common *bnet.Client // Set once before Run(), read-only after that *GatewayConfig // contains filtered or unexported fields }
Gateway manages a BNet connection
func (*Gateway) ChannelUsers ¶ added in v0.9.0
ChannelUsers online
func (*Gateway) FindTrigger ¶ added in v0.9.0
FindTrigger checks if s starts with trigger, return Trigger{} if true
func (*Gateway) InitDefaultHandlers ¶
func (b *Gateway) InitDefaultHandlers()
InitDefaultHandlers adds the default callbacks for relevant packets
func (*Gateway) SayPrivate ¶ added in v0.9.0
SayPrivate sends a private chat message to uid
func (*Gateway) SetUserAccess ¶ added in v0.9.0
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 HomeChannel string BufSize uint8 AvatarIconURL string AvatarDefaultURL string AccessWhisper gateway.AccessLevel AccessTalk gateway.AccessLevel AccessNoWarcraft gateway.AccessLevel AccessOperator gateway.AccessLevel AccessLevel map[int]gateway.AccessLevel AccessClanTag map[string]gateway.AccessLevel AccessUser map[string]gateway.AccessLevel }
GatewayConfig stores the config additions of bnet.Gateway over bnet.Client
Click to show internal directories.
Click to hide internal directories.