func (r *Room) SetCommands(commands Commands) {
	r.commands = commands
}
SetCommands sets the room's command handlers.
package chat
import (
	"errors"
	"fmt"
	"io"
	"sort"
	"sync"
	"github.com/shazow/ssh-chat/chat/message"
	"github.com/shazow/ssh-chat/internal/humantime"
	"github.com/shazow/ssh-chat/set"
)
const historyLen = 20
const roomBuffer = 10
var ErrRoomClosed = errors.New("room closed")
var ErrInvalidName = errors.New("invalid name")
type Member struct {
	*message.User
	IsOp bool
	mu      sync.Mutex
	isMuted bool  
}
func (m *Member) IsMuted() bool {
	m.mu.Lock()
	defer m.mu.Unlock()
	return m.isMuted
}
func (m *Member) SetMute(muted bool) {
	m.mu.Lock()
	defer m.mu.Unlock()
	m.isMuted = muted
}
type Room struct {
	topic     string
	history   *message.History
	broadcast chan message.Message
	commands  Commands
	closed    bool
	closeOnce sync.Once
	Members *set.Set
}
func NewRoom() *Room {
	broadcast := make(chan message.Message, roomBuffer)
	return &Room{
		broadcast: broadcast,
		history:   message.NewHistory(historyLen),
		commands:  *defaultCommands,
		Members: set.New(),
	}
}