def message_send(self, to, msg):
"""
Transmit a text message to a recipient.
:param to:
mobile number (without + or 00) or Jid of the recipient
:type to: str
:param msg:
message text to transmit.
:type msg: str|bytes
:return:
future for async notification
"""
if isinstance(msg, str):
msg = msg.encode("utf-8")
outgoingMessage = TextMessageProtocolEntity(msg, to=self.normalize_jid(to))
self.toLower(outgoingMessage)
# Assume successful transmission
fut = Future()
fut.set_result("Done")
return fut
评论列表
文章目录