Documentation ¶
Index ¶
- type Channel
- type ChannelTracker
- func (p *ChannelTracker) Channels() []*Channel
- func (p *ChannelTracker) LookupChannel(channel string) *Channel
- func (p *ChannelTracker) LookupUser(user string) *User
- func (p *ChannelTracker) RegisterSessionCleanupCallback(f func(u *User))
- func (p *ChannelTracker) UsersInChannel(channel string) []*User
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel is an internal type for representing a channel.
type ChannelTracker ¶
type ChannelTracker struct {
// contains filtered or unexported fields
}
ChannelTracker is a simple plugin which is only meant to track what channels the bot is in, and what users are in a channel. It also provides a uuid mapping to a user, so if a user's nick changes, we'll still have a sort of "session" to keep track of them.
func CtxChannelTracker ¶
func CtxChannelTracker(ctx context.Context) *ChannelTracker
func (*ChannelTracker) Channels ¶
func (p *ChannelTracker) Channels() []*Channel
Channels will return all the channel objects this bot knows about.
func (*ChannelTracker) LookupChannel ¶
func (p *ChannelTracker) LookupChannel(channel string) *Channel
LookupChannel will return the Channel object for the given channel name or nil if we're not in that channel.
func (*ChannelTracker) LookupUser ¶
func (p *ChannelTracker) LookupUser(user string) *User
LookupUser will return the User object for the given nick or nil if we don't know about this user. The returned value can be stored and will track this user even if they change nicks.
func (*ChannelTracker) RegisterSessionCleanupCallback ¶
func (p *ChannelTracker) RegisterSessionCleanupCallback(f func(u *User))
RegisterSessionCleanupCallback lets you register a function to be called when a session is removed.
func (*ChannelTracker) UsersInChannel ¶
func (p *ChannelTracker) UsersInChannel(channel string) []*User
UsersInChannel will return all the users in the given channel name or nil if we're not in that channel.