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.

Community
  • 1
  • 1
Ime Ime
  • 133
  • 5
  • 12

1 Answers1

0

@Torxed pointed you at the method in his answer:

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

Here's how you'd use it:

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

Do be careful, though as this merely adds the FIRST result returned by the search. If you have the username exact, it should be fine.

Sam Gerber
  • 101
  • 2