如果我们有这个用于 msn 的 Pidgin 代码:
#!/usr/bin/python
import sys, dbus, gobject;
bus = dbus.SessionBus()
obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
msnusers = (["someon@hotmail.com", "someoneelse@msn.com", "thatguy@hotmail.com", "somethingoranother@hotmail.com"])
for msn_id in msnusers:
account_id = purple.PurpleAccountsGetAllActive()[0]
conversation = purple.PurpleConversationNew(1, account_id, msn_id)
im = purple.PurpleConvIm(conversation)
purple.PurpleConvImSend(im, 'hi')
我需要对whatsapp使用相同的方式,但我找不到它如何
我试试这个,但它不起作用:
#!/usr/bin/python
import sys, dbus, gobject;
bus = dbus.SessionBus()
obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
wpusrs = str(96895605520)
for i in wpusrs:
account = purple.PurpleAccountsGetAllActive()
conversation = purple.PurpleConversationNew(1,account,i)
im = purple.PurpleConvIm(conversation)
purple.PurpleConvImSend(im,'hi')
请帮助我:'(