func (c *Channel) HasBan(ban string) bool {
	return c.Modes.isAddressSet(banMode, ban)
}
HasBan checks to see if a specific mask is present in the banlist.
package data
import (
	"strings"
	"github.com/aarondl/ultimateq/api"
	"github.com/aarondl/ultimateq/irc"
)
const (
	banMode = 'b'
)
type Channel struct {
	Name  string       `json:"name"`
	Topic string       `json:"topic"`
	Modes ChannelModes `json:"channel_modes"`
}
func NewChannel(name string, m *modeKinds) *Channel {
	if len(name) == 0 {
		return nil
	}
	return &Channel{
		Name:  name,
		Modes: NewChannelModes(m),
	}
}
func (c *Channel) Clone() *Channel {
	return &Channel{c.Name, c.Topic, c.Modes.Clone()}
}
func (c *Channel) IsBanned(host irc.Host) bool {
	if !strings.ContainsAny(string(host), "!@") {
		host += "!@"
	}
	bans := c.Modes.Addresses(banMode)
	for i := 0; i < len(bans); i++ {
		if irc.Mask(bans[i]).Match(host) {
			return true
		}
	}
	return false
}
func (c *Channel) SetBans(bans []string) {
	delete(c.Modes.modes, banMode)
	for i := 0; i < len(bans); i++ {
		c.Modes.setAddress(banMode, bans[i])
	}
}
func (c *Channel) AddBan(ban string) {
	c.Modes.setAddress(banMode, ban)
}
func (c *Channel) Bans() []string {
	getBans := c.Modes.Addresses(banMode)
	if getBans == nil {
		return nil
	}
	bans := make([]string, len(getBans))
	copy(bans, getBans)
	return bans
}