These are chat archives for littlecodersh/ItChat

24th
Feb 2017
Corning Sun
@corningsun
Feb 24 2017 06:10
@FrankKai 网络问题吧,试试网页版微信 能不能登陆
Corning Sun
@corningsun
Feb 24 2017 06:54

def search_friends(self, name=None, userName=None, remarkName=None, nickName=None,
wechatAccount=None):
return self.storageClass.search_friends(name, userName, remarkName,
nickName, wechatAccount)

返回值,应该怎么取?

直接print会报错
UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if any([m.get(k) == name for k in ('RemarkName', 'NickName', 'Alias')]):
Corning Sun
@corningsun
Feb 24 2017 09:03
文件解决了,是因为查询条件中使用了中文,需要先将中文编码
问题解决方法:queryKey = "中文".decode("UTF-8")
rooms = itchat.search_chatrooms(name=queryKey)