danni-cool/wechatbot-webhook

FAQ 遇到问题可先自查

danni-cool opened this issue · 6 comments

1. 登陆问题

1.1 微信个人信息合规问题 (新号请:实名+绑定手机号+绑定银行卡)

  • 因为微信未实名导致登陆不了。see #39
  • 因为未开通微信支付登陆不了 see #5
  • 因为未绑定银行卡导致登陆不了 see #88

1.2 登录时 AssertionError: 1205 == 0

  • 尝试手机上退出重新登录。see #188

1.3 触发了微信风控机制被限制登录

  • 等数个小时 or 天后 or 换个账号尝试。see #210

2. 掉线问题

2.1 登陆一段时间后掉线问题,web协议受微信风控策略控制,固定2天一掉,如果合理使用则会增加在线时间

2. 发送消息问题

2.2 文字没法换行,请使用 \n 转义字符

2.3发送图片消息 1205 == 0

  • 有可能是发送太频繁 #194
  • 尝试降低发送频率或者间隔一段时间 #216

2.4 字符编码问题

  • windows bash 因为字符编码问题 see #21

2.5 无法给文件传输助手发消息 User is not found

  • 大概率是被微信风控了,微信爸爸把文件传输助手从你的通讯录里摘除了,所以不要乱搞文件传输助手 (比如1小时发一条消息给文件传输助手)#21 (comment)

2.6无法艾特人

2.7发送昵称重复时会发给谁

  • 发给第一个匹配到的人

2.8发送消息时 {"success":false,"message":"Unauthorized: Access is denied due to invalid credentials."}

2.9 发送给备注名时格式错误

3. 联系人or群成员信息不是最新的

3.1 wechaty 信息同步问题:暂时不修复,重启容器解决(欢迎贡献PR)

4. 收消息问题

4.1 无法区分是否是真 @,Wechaty 也是不区分的,有一原则上真 @ 和 @+手打你的昵称都算

4.2 如何判断消息是否是引用消息

请问下发送的文件URL,是否支持外网地址呢。
"data": { "type": "fileUrl" , "content": "https://pbs.twimg.com/media/GP6jidHbQAEN_Lv.jpg" }

请问下发送的文件URL,是否支持外网地址呢。 "data": { "type": "fileUrl" , "content": "https://pbs.twimg.com/media/GP6jidHbQAEN_Lv.jpg" }

不解决墙的问题

请问下 发送文件的接口,改成 python 的写法如何编写的,一直提示 "request body is not a valid json! checkout please."

curl --location --request POST 'http://localhost:3001/webhook/msg?token=[YOUR_PERSONAL_TOKEN]'
--form 'to=testGroup'
--form content=@"$HOME/demo.jpg"
--form 'isRoom=1'

python 代码如下:
headers = {}
files = {
'content': (file_name, open(_wx_bot_file_path, 'rb'), mime_type),
}
data = {
'to': 'test',
'isRoom': '1' # 确保值为字符串,避免可能的数据类型问题
}
params = {
'token': '123456'
}
r = requests.post(self.send_message_api_url, headers=headers, files=files, data=data, params=params)
print(f'respone: {r.text}')

不应该是json=data嘛,不是data=data吧

---原始邮件--- 发件人: @.> 发送时间: 2024年6月13日(周四) 晚上9:01 收件人: @.>; 抄送: @.>; 主题: Re: [danni-cool/wechatbot-webhook] FAQ 遇到问题可先自查 (Issue #72) 请问下 发送文件的接口,改成 python 的写法如何编写的,一直提示 "request body is not a valid json! checkout please." curl --location --request POST 'http://localhost:3001/webhook/msg?token=[YOUR_PERSONAL_TOKEN]' --form 'to=testGroup' --form content=@"$HOME/demo.jpg" --form 'isRoom=1' python 代码如下: headers = {} files = { 'content': (file_name, open(_wx_bot_file_path, 'rb'), mime_type), } data = { 'to': 'test', 'isRoom': '1' # 确保值为字符串,避免可能的数据类型问题 } params = { 'token': '123456' } r = requests.post(self.send_message_api_url, headers=headers, files=files, data=data, params=params) print(f'respone: {r.text}') — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>

改成 json=data 还是提示 request body is not a valid json! checkout please.
r = requests.post(self.send_message_api_url, headers=headers, files=files, json=data, params=params)

image

files = {'content': open(_wx_bot_file_path, 'rb')}
data = {
'to': "test",
'isRoom': "1"
}

r = requests.post(self.send_message_api_url, files=files, data=data)

这样可以了!