问题
can someone help me with automatically accepting a friend request with Skype4Py? Right now I'm using
def UserAuthorizationRequestReceived(user):
user.IsAuthorized = true
and
skype.UserAuthorizationRequestReceived = UserAuthorizationRequestReceived
But it doesn't seem to be working Thanks!
(Documentation: http://skype4py.sourceforge.net/doc/html/)
回答1:
From the documentation for Skype4Py::utils::EventHandlingBase:
C{On...} properties.
This method lets you use any callables as event handlers. Simply assign them to C{On...} properties (where "C{...}" is the name of the event) of the object whose events you are interested in. For example::
import Skype4Py def user_status(Status): print 'The status of the user changed' skype = Skype4Py.Skype() skype.OnUserStatus = user_status
You need to attach the function to skype.OnUserAuthorizationRequestReceived
instead.
Hopefully, you're doing some check to make sure that your application will not be the target of spam attacks because you're accepting all requests.
来源:https://stackoverflow.com/questions/19924794/accept-friend-request-on-skype4py