2

I saw this thread:

Skype4Py - How to successfully add a contact?

and at the bottom this code:

sky = Skype4Py.Skype()
sky.Attach()
user = sky.SearchForUsers('someUser')
print user

and quote:

Should get you a handle to add me for instance. Within the object that you recieve, there will be an option to add me for instance.

So my question is "What function exactly within that object, because I found nothing like "addContact()" in docs???"

Here is link to docs:

http://skype4py.sourceforge.net/doc/html/

or option 2:

Should I go pressing buttons (sending events) trough client object?

sky = Skype4Py.Skype()
sky.Attach()

client = Skype4Py.client.Client(sky)
client.OpenAddContactDialog("someUser")

Simple 20 lines snippet would clarify this to me, because beside that docs link there are virtually any examples for skype4py on google.

4

1 回答 1

0

@Torxed 在他的回答中指出了你的方法:

http://skype4py.sourceforge.net/doc/html/Skype4Py.user.User-class.html#SetBuddyStatusPendingAuthorization

下面是你如何使用它:

import Skype4Py
sky = Skype4Py.Skype()
sky.Attach()
requestMessage = "Please accept my request!"
searchResults = sky.SearchForUsers('echo123')
firstResult = searchResults[0]
firstResult.SetBuddyStatusPendingAuthorization(requestMessage)

请务必小心,因为这只会添加搜索返回的 FIRST 结果。如果你有确切的用户名,那应该没问题。

于 2016-03-14T05:16:27.517 回答