Skip to content

Instantly share code, notes, and snippets.

@RoyXiang
Created February 12, 2017 10:04
Show Gist options
  • Select an option

  • Save RoyXiang/098eb476215e74777a35d43554dcbd2a to your computer and use it in GitHub Desktop.

Select an option

Save RoyXiang/098eb476215e74777a35d43554dcbd2a to your computer and use it in GitHub Desktop.
diff --git a/plugins/eh_wechat_slave.py b/plugins/eh_wechat_slave.py
index 032608b..8318dd7 100644
--- a/plugins/eh_wechat_slave.py
+++ b/plugins/eh_wechat_slave.py
@@ -687,8 +687,12 @@ class WeChatChannel(EFBChannel):
else:
raise EFBMessageTypeNotSupported()
- if isinstance(r, dict) and r.get('BaseResponse', dict()).get('Ret', -1) != 0:
- raise EFBMessageError(str(r))
+ if isinstance(r, dict):
+ ret = r.get('BaseResponse', dict()).get('Ret', -1)
+ if ret != 0:
+ if ret == 1101:
+ self.itchat.logout()
+ raise EFBMessageError(str(r))
else:
msg.uid = r.get("MsgId", None)
return msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment