def annoy_user(self): msg = "Let's free the pandas ! (testing papyon)" formatting = papyon.TextFormat("Comic Sans MS", papyon.TextFormat.UNDERLINE | papyon.TextFormat.BOLD, 'FF0000') self._client.send_text_message(papyon.ConversationMessage(msg, formatting)) # self._client.send_nudge() # self._client.send_typing_notification() return True
def send_message(self, msg, formatting=None): """ @type msg: L{amsn2.views.stringview.StringView} @type formatting: L{papyon.papyon.conversation.TextFormat} """ # for the moment, no smiley substitution... (TODO) self.on_message_received(msg, formatting=formatting) message = papyon.ConversationMessage(unicode(msg), formatting) self._conv.send_text_message(message)
def _send_text_message(self, message_type, text): "Send a simple text message, return true if sent correctly" if self._conversation is not None: if message_type == telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL: logger.info("Sending message : %s" % unicode(text)) self._conversation.send_text_message( papyon.ConversationMessage(text)) else: raise telepathy.NotImplemented("Unhandled message type") return True else: logger.warning('Tried sending a message with no conversation') return False
def send(self): message = papyon.ConversationMessage(self.options.send) self._conversation.send_text_message(message) return self.options.repeat
def sendMessage(self, msg, formatting=None): """ msg is a StringView """ # for the moment, no smiley substitution... (TODO) self.onMessageReceived(msg, formatting=formatting) message = papyon.ConversationMessage(str(msg), formatting) self._conv.send_text_message(message)