Documentation
¶
Overview ¶
Package nullconn holds a null connection that satisfies interfaces.Bot
Index ¶
- type NullConn
- func (n *NullConn) AdminLevel(source string) int
- func (n *NullConn) Connect() error
- func (n *NullConn) Disconnect(msg string)
- func (n *NullConn) HookJoin(_ func(source, channel string))
- func (n *NullConn) HookKick(_ func(source, channel, target, message string))
- func (n *NullConn) HookMessage(_ func(source, channel, message string, isAction bool))
- func (n *NullConn) HookNick(_ func(source, newNick string))
- func (n *NullConn) HookPart(_ func(source, channel, message string))
- func (n *NullConn) HookPrivateMessage(_ func(source, channel, message string))
- func (n *NullConn) HookQuit(_ func(source, message string))
- func (n *NullConn) HumanReadableSource(source string) string
- func (n *NullConn) IsCommandPrefix(l string) (string, bool)
- func (n *NullConn) JoinChannel(name string)
- func (n *NullConn) Reload(conf interfaces.Unmarshaler) error
- func (n *NullConn) Run() error
- func (n *NullConn) SendAdminMessage(msg string)
- func (n *NullConn) SendMessage(target, msg string)
- func (n *NullConn) SendNotice(target, msg string)
- func (n *NullConn) SendRaw(string)
- func (n *NullConn) StaticCommandPrefixes() []string
- func (n *NullConn) Status() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NullConn ¶
type NullConn struct {
// contains filtered or unexported fields
}
NullConn is an implementation of interfaces.Bot that is one giant no-op (with logging) Its good for testing or simply to use gggb as a management engine for games without the chat portions
func (*NullConn) AdminLevel ¶
AdminLevel returns the permission level that a given source has. It should return zero for sources with no permissions
func (*NullConn) Connect ¶
Connect connects to the service. It MUST NOT block after negotiation with the service is complete
func (*NullConn) Disconnect ¶
Disconnect disconnects the bot from the service accepts a message for a reason, and should make Run return
func (*NullConn) HookMessage ¶
HookMessage hooks on messages to a channel
func (*NullConn) HookPrivateMessage ¶
HookPrivateMessage hooks on messages to us directly
func (*NullConn) HookQuit ¶
HookQuit hooks on users disconnecting (for services that differentiate it from the above)
func (*NullConn) HumanReadableSource ¶
HumanReadableSource converts the given message source to one that is human readable
func (*NullConn) IsCommandPrefix ¶
IsCommandPrefix returns the given string and nothing else, as we dont implement it
func (*NullConn) JoinChannel ¶
JoinChannel joins the given channel
func (*NullConn) Reload ¶
func (n *NullConn) Reload(conf interfaces.Unmarshaler) error
Reload reloads the Bot using the given (string) config
func (*NullConn) Run ¶
Run runs the bot, it should Connect() to the service and MUST block until connection is lost
func (*NullConn) SendAdminMessage ¶
SendAdminMessage sends the given message to the administrator
func (*NullConn) SendMessage ¶
SendMessage sends a message to the given target
func (*NullConn) SendNotice ¶
SendNotice sends a message that should not be responded to to the given target
func (*NullConn) StaticCommandPrefixes ¶
StaticCommandPrefixes returns the bot's current command prefixes