本文整理汇总了Python中Yowsup.connectionmanager.YowsupConnectionManager.sendGetParticipants方法的典型用法代码示例。如果您正苦于以下问题:Python YowsupConnectionManager.sendGetParticipants方法的具体用法?Python YowsupConnectionManager.sendGetParticipants怎么用?Python YowsupConnectionManager.sendGetParticipants使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Yowsup.connectionmanager.YowsupConnectionManager
的用法示例。
在下文中一共展示了YowsupConnectionManager.sendGetParticipants方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Worker
# 需要导入模块: from Yowsup.connectionmanager import YowsupConnectionManager [as 别名]
# 或者: from Yowsup.connectionmanager.YowsupConnectionManager import sendGetParticipants [as 别名]
#.........这里部分代码省略.........
self.session.contacts.me.status = self.session.account.status
#self.send_presence("available", account)
# Your account
#tmp_cont = e3.base.Contact(account, 1, account, account, e3.status.BUSY, '', True)
#self.session.contacts.contacts[account] = tmp_cont
def onGroupGotPartecipants(self, group, parts):
g = ""
for part in parts:
if not self._check_if_contact_exist (part):
self._add_contact(part, part, e3.status.ONLINE, part, False, "")
def onGroupGotInfo(self, info):
print "infoooooooooooooooooooooooooooooooo"
print info
print "infoooooooooooooooooooooooooooooooo"
def onGroupMessageReceived(self, msgId, fromAttribute, author, msgData, timestamp, wantsReceipt, pushName):
print "You got a group message!"
print "%s (%s, %s): %s" % (pushName, author, timestamp, msgData)
print fromAttribute
# Add the group
if not self._check_if_contact_exist (fromAttribute):
#print fromAttribute
#self.methodsInterface.call ("group_getInfo", (fromAttribute))
#self.methodsInterface.call ("group_getParticipants", (fromAttribute))
self.connectionManager.sendGetParticipants (fromAttribute)
#self.connectionManager.sendGetGroupInfo (fromAttribute)
self._add_contact(fromAttribute, "Group chat", e3.status.ONLINE, "Group chat", False, "")
# Add the single contact
if not self._check_if_contact_exist (author):
self._add_contact(author, pushName, e3.status.ONLINE, pushName, False, "")
self._on_group_message({'id':msgId, 'from':{'jid':author, 'realname':pushName}, 'type':'chat', 'body':msgData}, fromAttribute)
#TODO enable ack
if wantsReceipt:
self.methodsInterface.call("message_ack", (fromAttribute, msgId))
def onMessageReceived(self, messageId, jid, messageContent, timestamp, wantsReceipt, pushName, isBroadcast):
print "You got a message!"
print "%s (%s, %s): %s" % (pushName, jid, timestamp, messageContent)
if not self._check_if_contact_exist (jid):
self._add_contact(jid, pushName, e3.status.ONLINE, pushName, False, "")
self._on_message({'id':messageId, 'from':{'jid':jid, 'realname':pushName}, 'type':'chat', 'body':messageContent})
#TODO enable ack
if wantsReceipt:
self.methodsInterface.call("message_ack", (jid, messageId))
# Emesene events handler
#def _on_conversation_message_received(self, message):
# e3.Logger.log_message(self.session, participants, msgobj, sent, cid = cid)