Skype4Py-如何成功添加联系人? [英] Skype4Py - How to successfully add a contact?

查看:139
本文介绍了Skype4Py-如何成功添加联系人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力通过SkypeBot实现一些有趣的功能,而我想实现的功能之一就是可以添加新联系人。在查看Skype4Py文档时,我注意到此方法:

I'm working to implement a few fun features with a SkypeBot, and one of the features I'd like to implement is the ability to add a new contact. While reviewing the Skype4Py docs, I note this method:

http://skype4py.sourceforge.net/doc/html/Skype4Py.client.Client-class.html#OpenAddContactDialog

我正在使用以下代码尝试访问此代码:

I am using the following code to try to access this:

sky = Skype4Py.Skype()
client = Skype4Py.client.Client(sky)
sky.Attach()
client.OpenAddContactDialog("test")

但是,当尝试利用Skype4py.client.Client的几乎所有内容时,我的回溯超时:

However, when trying to utilize almost anything from Skype4py.client.Client I get a timeout with the traceback:

Traceback (most recent call last):
 File "<input>", line 1, in <module>
 File "build/bdist.macosx-10.8-intel/egg/Skype4Py/client.py", line 164, in OpenDialog
 self._Skype._DoCommand('OPEN %s' % tounicode(' '.join(params)))
 File "build/bdist.macosx-10.8-intel/egg/Skype4Py/skype.py", line 276, in _DoCommand
 self.SendCommand(command)
 File "build/bdist.macosx-10.8-intel/egg/Skype4Py/skype.py", line 778, in SendCommand
 self._Api.send_command(Command)
 File "build/bdist.macosx-10.8-intel/egg/Skype4Py/api/darwin.py", line 395, in send_command
raise SkypeAPIError('Skype command timeout')
SkypeAPIError: Skype command timeout

我在客户端类中尝试访问的每种方法都收到此超时错误。 (即:
OpenAuthorizationDialog,OpenCallHistoryTab,OpenContactsTab)。我是否错误地访问了此方法,或者较新版本的Skype不支持该方法?对于使此工作正常运行的任何帮助,或成功通过Skype4Py添加联系人的方法,将不胜感激。

I receive this timeout error on every method I try to access within the client class. (ie: OpenAuthorizationDialog, OpenCallHistoryTab, OpenContactsTab). Am I accessing this method incorrectly, or perhaps the method is not supported for newer versions of Skype? Any help with getting this working, or a method that adds contacts via Skype4Py successfully will be very appreciated.

推荐答案

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

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

尝试一些尝试,但我99%确信那是您必须执行的顺序做事。
否则您会超时,因为附件需要时间来附加,然后才开始对API执行操作。

Trying a few things out but i'm 99% sure that's the order in which you have to do things. Otherwise you will time out because the attachment needs time to attach before you start executing things towards the API.

还请注意:

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

另外,您可能会以错误的方式进行操作。
不是直接添加Skype用户,这不是Skype的工作原理。

Also you might be going about this the wrong way. Adding a skype user directly, is not how Skype works.


  1. search

  2. 请求添加消息

  3. 等待授权

因此,请尝试以下操作之一:
(一种是异步的搜索和添加方法,当它们弹出时,另一种会束缚您的结果)

So, try one of the following: (one is a asyncore way of searching and adding as they pop up, the other will bunch your results)

  • http://skype4py.sourceforge.net/doc/html/Skype4Py.skype.Skype-class.html#AsyncSearchUsers
  • http://skype4py.sourceforge.net/doc/html/Skype4Py.skype.Skype-class.html#SearchForUsers

所以尝试:

sky = Skype4Py.Skype()
sky.Attach()
print skyp.SearchForUsers('Torxed')

应该让您适应例如加我。
在您收到的对象中,将有一个添加我的选项。

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.

这篇关于Skype4Py-如何成功添加联系人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆