我正在尝试编写一个自动处理 Skype 授权请求的应用程序。最终目的是允许平台用户通过向特定平台的 Skype 用户发送消息来附加和确认他们的个人 Skype 句柄。
具体来说,我有兴趣从应用用户的联系人列表中授权和删除用户。我已经彻底阅读了 Linux Skype4Py 的 Python 文档,但没有找到任何有用的方法。当我尝试覆盖未经授权用户的 BuddyStatus 时,我得到:
for user in skype.UsersWaitingAuthorization:
print "User: " + user.Handle + " " + str(user.BuddyStatus) # note that _GetBuddyStatus() works here
if not user.ReceivedAuthRequest.startswith("special-marker"):
user.BuddyStatus = -1;
Traceback (most recent call last):
File "gn-discovery-skype.py", line 60, in <module>
user.BuddyStatus = -1;
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/user.py", line 80, in _SetBuddyStatus
self._Property('BUDDYSTATUS', int(Value), Cache=False)
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/user.py", line 19, in _Property
return self._Owner._Property('USER', self.Handle, PropName, Set, Cache)
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/skype.py", line 311, in _Property
self._DoCommand('SET %s %s' % (jarg, value), jarg)
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/skype.py", line 281, in _DoCommand
raise SkypeError(int(errnum), errstr)
Skype4Py.errors.SkypeError: [Errno 518] Invalid status given for BUDDYSTATUS
会不会是 Skype(因为 Skype4Py 接受状态)实际上根本不允许控制用户授权,而将其严格留给实际的 Skype 用户?