Comments (21)
屌屌的。py3有bug吗
from itchat.
@qianyuxiang 我简单的试用了一下没发现bug
from itchat.
报告一个BUG:
itchat.set_oplog(msg['FromUserName'],'测试用户ID')
设置备注名后,在用get_alias获取到的依然是昵称,不是备注名,需要重新运行机器人后才能拿到新的备注名
环境是py 3.5.1
from itchat.
@pcloth 收到
from itchat.
robot分支有计划能做python3分支么?我自己尝试了下好难改
from itchat.
我在Python3的环境下pip install itchat,但是提示没有一个thread模块,尝试安装thread也安装不了
from itchat.
@chixinmu 有更详细的报错吗?
from itchat.
from itchat.
windows 7 下,Python3.4.2 在cmd命令行下运行pip install itchat,出现No module named 'thread'的情况,我是新手,查到thread是多线程库,但是不知道为什么,在windows下没有安装
from itchat.
查到在Python3.4.2中,thread应为:_thread
from itchat.
@chixinmu 是我这里更新版本的问题,1.0.11版本的时候没有把py3的内容上传上去。
你现在尝试一下这个命令:
py -3 -m pip install itchat --no-cache-dir
from itchat.
@littlecodersh OK,已经安装完成了,谢谢!
from itchat.
在 py3 的版本里,移除了群聊中 msg
的 isAt
属性,所以例子是跑不起来的。
File "run.py", line 23, in text_reply
if msg['isAt']:
KeyError: 'isAt'
我猜想,做 py3 的这位同学应该是觉得这个部分应该由 handler 自己决定吧。在 py2 的版本里,代码为
isAt = self.storageClass.nickName in Content
这里的判断个人感觉弱了点,至少把 @
加进去变成
isAt = '@{}'.format(self.storageClass.nickName) in Content
还有如果群聊中发送的一段话如果带空格,会只取第一部分,这个有特别的原因吗?
if b'\342\200\205'.decode('utf8') in Content:
Content = Content.split(b'\342\200\205'.decode('utf8'))[1]
顺便说一句为什么切换到 py3,因为 py2 下面例子里面群聊的发送者中文昵称是乱码,打印之后是类似下面的东西
u'\xe4\xb8\x8d\xe6\x92\xa9'
这个字符串已经是 utf8 了,然而不知道哪个环节又给加上了 unicode 的标记。不过 py2 的字符集问题本来就很恼人。。。
from itchat.
- py3的例子当中并没有用到
isAt
属性:py3主页 isAt
属性没加是因为那是py3
分支出去以后的更新- 判断的确很弱,只是一个简单的试用。主要问题在与
emoji
的输入输出统一还没有做好。其实如果要加强也很简单,就在判断时跟上'\342\200\205'
即可 - 那个取的是第二部分,因为现在只支持
@robot content
类型,具体原因也是emoji
- 这个不应该呀,
client.py
129行在接收到消息时就进行了decode
,给我看下你使用的程序吧,可能是我们这里出了点什么问题。
from itchat.
前面的问题大概都明白了,最后一个确实比较奇怪。整个返回值只有发送者昵称有问题,就是跑的项目首页例子。
安装是 pip 装的,然后自己复制了所有代码 直接命令行运行。找了个群让同事试了一下,发现自动回复的内容里面对方昵称是乱码,切换到py3 没有这个问题。
from itchat.
@liangshan 是特定的一个昵称有问题吗?如果是的话,方便给我一下完整的那个昵称吗?
from itchat.
不是特定的昵称,所有带汉字的都不行。运行的就是 master 也就是 python 2.7 的例子,具体版本号 应该是 python2.7.10
from itchat.
@liangshan 感谢你的报错,我这里已经复现了问题,会在下一个版本中更新到pypi。
问题出在requests
的json()
方法上,把129行的内容更换为一下内容即可:
j = json.loads(self.s.post(url, data = json.dumps(payloads), headers = headers
).content.decode('utf8', 'replace'))['ContactList'][0]
from itchat.
能不能自定义自动回复的信息?
from itchat.
@Peteling 可以呀,return不同的内容或者调用itchat.send
即可
from itchat.
由于python3版本已经并入主分支,该issue关闭
from itchat.
Related Issues (20)
- Hi how i yours the App
- 现在微信网页版无法登录,还能用itchat吗 HOT 11
- iPhone手机上的8.0.43版本微信是不是改VOIP了?
- 视频号 HOT 1
- ???
- 错误
- 17年6月下旬前登陆过web网页版的微信可以使用此框架,验证微信是否支持web版本API,请点击https://wx.qq.com/ ,扫码验证即可,假如出现无法登陆,则不适用于此框架 HOT 3
- itchat.send_video 运行没有效果 HOT 2
- 如何获得微信群群人数
- 【无法登录】“为了保障你的账号安全,暂不支持使用网页版微信。你可以前往微信官网” HOT 3
- ?
- ?
- 可以与jenkins集成吗?将jenkins构建的结果推送到普通微信群中
- 关于thread过时
- 获取什么作为群聊用户的永久唯一标识? HOT 4
- set_alias修改好友备注接口怎么没有生效 HOT 3
- 我在登录后出现'xml.parsers.expat.ExpatError: mismatched tag: line 64, column 4' 怎么解决 HOT 9
- 国务院的人都是一群鲨跸 HOT 4
- 【!!!研发必看!!!】替代UOS WEB版,做机器人,小助手,营销系统,客服系统,监管系统的可以 看下这个API方案 HOT 5
- 能根据手机号获取微信头像昵称吗?个人签名。 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itchat.