コード例 #1
0
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")
}
コード例 #2
0
func sendError(cmd commands.Command, player *player.Player, errc chan<- error) {
	if err := player.SendCommand(cmd); err != nil {
		errc <- err
	}
}