我正在尝试用这个不错的库进行一些测试。
我已经使用 yowsup-cli 成功地进行了测试,但现在我想创建一个小的 python 脚本以智能方式管理事件(使用监听器/回调)。
我正在尝试这里解释的代码https://github.com/tgalal/yowsup/wiki/Yowsup-Library-Documentation:
def onAuthSuccess(username):
print "Logged in with %s" % s
# make a call to method ready to be able to receive messages
methodsInterface.call("ready")
y = YowsupConnectionManager()
signalsInterface = y.getSignalsInterface()
methodsInterface = y.getMethodsInterface()
signalsInterface.registerListener("auth_success", onAuthSuccess)
methodsInterface.call("auth_login", ("username", "password"))
很明显,用户名应该是没有其他符号的国家号码 + 电话号码。但我不清楚应该在哪里找到密码。cli 的身份验证机制不同,它需要注册。
你能帮我吗?谢谢