Accept friend request on Skype4Py

孤街浪徒 提交于 2019-12-11 20:14:56

问题


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:

  1. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!