Beispiel #1
0
 def reply_message(self, message, body):
     """
     Reply to message with body.
     """
     response = Message(recipient=message.sender,
                        sender=message.recipient,
                        body=body)
     response.stanzaType = 'chat'
     self.send(response.toElement())
Beispiel #2
0
 def on_hello(self, message):
     response = Message(recipient=message.sender,
                        sender=message.recipient,
                        body="Hi I'm the backyard irrigation controller.")
     response.stanzaType = 'chat'
     self.send(response.toElement())