Fixes
- Fix
BadStatusLineand HTTP 503 errors in synccheck - Handle malformed synccheck responses (hex-encoded strings) that were causing crashes
Note: Response format unclear — monitor for edge cases if you rely on synccheck integration.
Unclaimed project
Are you a maintainer of ItChat? Claim this project to take control of your public changelog and roadmap.
Changelog
A complete and graceful API for Wechat. 微信个人号接口、微信机器人及命令行微信,三十行即可自定义个人号机器人。
AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Stable Diffusion web UI
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
A feature-rich command-line audio/video downloader
BadStatusLine and HTTP 503 errors in synccheckNote: Response format unclear — monitor for edge cases if you rely on synccheck integration.
增加了消息撤回方法,示例如下:
import itchat
itchat.auto_login(True)
user = itchat.search_friends(nickName='LittleCoder')[0]
r = user.send('hi')
msgId = r['MsgID']
r = itchat.revoke(msgId, user.userName)
itchat.run()
如果两个类互相引用将导致无法被正常回收,所以采取这种形式:
from weakref import ref
class D(object):
def __init__(self, name):
self.name = name
def __del__(self):
print('[deleted]: %s' % self.name)
class T(D):
@property
def pointer(self):
return getattr(self, '_pointer', lambda: None)()
@pointer.setter
def pointer(self, value):
self._pointer...
import itchat
user = itchat.get_friends()[0]
user.send('hi')
同样,群和公众号也是这样访问。
import itchat
@itchat.msg_register(itchat.content.TEXT)
def _(msg):
msg['User'].send('hi')
itchat.auto_login(True)
itchat.run...
获取用户头像:
import itchat, shutil
itchat.auto_login(True)
r = itchat.get_head_img(picDir='tmp.unknown')
print(r)
if 'PostFix' in r:
shutil.move('tmp.unknown', 'tmp.%s' % r['PostFix'])
获取聊天图片:
import itchat, shutil
itchat.auto_login(True)
@itchat.msg_register(itchat.content.PICTURE)
def download(msg):
r = msg['Text']('tmp.unknown')
print(r)...
import itchat
def qrCallback(uuid, status, qrcode):
if status == '400':
itchat.logout()
itchat.auto_login(True, qrCallback=qrCallback)
if itchat.originInstance.alive:
itchat.run()
else:
print('qrcode timeout and exit')
你可以这样测试:
首先成功登陆一次:
import itchat
itchat.auto_login(True)
之后在手机上将该登录状态登出。(模拟各类登出)
之后重新运行登陆,你将不需要扫码直接在手机上获得登陆推送。
import itchat
itchat.auto_login(True)
itchat.send('Login without qrcode!', 'filehelper')
在上次登陆后没有通过其他途径登陆该微信的情况下,再次登录将不再需要扫码,直接收到登陆推送。
Exceptions in registered functions will now be shown in warning level. When wechat domain is not available, exceptions will also be shown in warning level.
这个问题简而言之就是退了一个用户,之后本地不会删除该用户。
这里给出一个群聊人数监控的示例:
#coding=utf8
import logging
import itchat
from itchat.content import *
logger = logging.getLogger('itchat')
groupName = u'萝卜群'
groupMemberCount = -1
groupUserName = None
itchat.auto_login(True)
group = itchat.search_chatrooms(name=groupName)[0]
if not group['MemberList']:
logger.info('no member list detected')
group = itchat.u...
这个不用多说了吧,你试试大文件就好了
微信更新了附件的发送协议,所以我也更新了一下