From Python, 10 Years ago, written in Python.
Embed
  1.   def cmd_sayas(self, *message):
  2.         self.msg(self.context, "%s" % cid)
  3.         if not cid:
  4.             self.msg(self.context, "\x01ACTION \x035requires a client ID argument.\x01")
  5.             return            
  6.         message = " ".join(message).strip()
  7.         if not message:
  8.             self.msg(self.context, "\x01ACTION \x035requires a message to send. %s\x01" % self.cids[-1])
  9.             return
  10.         pclients = filter(lambda x: re.match(cid, x.id), self.ctx["clients"])
  11.         if not pclients:
  12.             self.msg(self.context, "\x01ACTION \x035found no such client to say as.\x01")
  13.             return
  14.         for client in pclients:
  15.             self.log(self.context, client, "M", "sayas", "".join(message))
  16.             self.emitmsg(client, message)