package models import ( "context" "errors" "time" ) // ErrChannelLookupNotAvailable is returned when channel lookup is not configured. var ErrChannelLookupNotAvailable = errors.New("channel lookup not available") // ChannelMember represents a user's membership in a channel. type ChannelMember struct { Base ChannelID string `json:"channelId"` UserID string `json:"userId"` Modes string `json:"modes"` JoinedAt time.Time `json:"joinedAt"` Nick string `json:"nick"` // denormalized from users table } // User returns the full User for this membership. func (cm *ChannelMember) User(ctx context.Context) (*User, error) { return cm.LookupUser(ctx, cm.UserID) } // Channel returns the full Channel for this membership. func (cm *ChannelMember) Channel(ctx context.Context) (*Channel, error) { return cm.LookupChannel(ctx, cm.ChannelID) }