func (c CommandSay) Exec(plr, opt *player.Player) error { if len(c.Args) > 0 { plr.SendCommand(NewCommandSay(c.Args[0], PLR)) opt.SendCommand(NewCommandSay(c.Args[0], OPT)) return nil } return errors.New("nothing to say") }
func sendError(cmd commands.Command, player *player.Player, errc chan<- error) { if err := player.SendCommand(cmd); err != nil { errc <- err } }