def sendmsg(self, to, txt, chat=False): msg = YobotMessage() if chat: msg.yprotoflags = yobotproto.YOBOT_MSG_TYPE_CHAT else: msg.yprotoflags = yobotproto.YOBOT_MSG_TYPE_IM msg.yprotoflags |= yobotproto.YOBOT_MSG_TO_SERVER msg.txt = txt msg.acctid = self.id msg.time = time() msg.name = to self.svc.sendMsg(msg)