Merge pull request #48 from lich0821/3.9.2.23

Update
This commit is contained in:
Changhua 2023-07-12 23:24:34 +08:00 committed by GitHub
commit a37b7ce5ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,7 @@ setup(
"setuptools", "setuptools",
"fastapi", "fastapi",
"uvicorn[standard]", "uvicorn[standard]",
"wcferry==37.1.25.5", "wcferry==39.0.0.0a3",
], ],
classifiers=[ classifiers=[
"Environment :: Win32 (MS Windows)", "Environment :: Win32 (MS Windows)",

View File

@ -10,7 +10,7 @@ from fastapi import Body, FastAPI
from pydantic import BaseModel from pydantic import BaseModel
from wcferry import Wcf, WxMsg from wcferry import Wcf, WxMsg
__version__ = "37.1.25.5" __version__ = "39.0.0.0a3"
class Msg(BaseModel): class Msg(BaseModel):
@ -50,8 +50,8 @@ class Http(FastAPI):
self.add_api_route("/text", self.send_text, methods=["POST"], summary="发送文本消息") self.add_api_route("/text", self.send_text, methods=["POST"], summary="发送文本消息")
self.add_api_route("/image", self.send_image, methods=["POST"], summary="发送图片消息") self.add_api_route("/image", self.send_image, methods=["POST"], summary="发送图片消息")
self.add_api_route("/file", self.send_file, methods=["POST"], summary="发送文件消息") self.add_api_route("/file", self.send_file, methods=["POST"], summary="发送文件消息")
self.add_api_route("/xml", self.send_xml, methods=["POST"], summary="发送 XML 消息") # self.add_api_route("/xml", self.send_xml, methods=["POST"], summary="发送 XML 消息")
self.add_api_route("/emotion", self.send_emotion, methods=["POST"], summary="发送表情消息") # self.add_api_route("/emotion", self.send_emotion, methods=["POST"], summary="发送表情消息")
self.add_api_route("/sql", self.query_sql, methods=["POST"], summary="执行 SQL如果数据量大注意分页以免 OOM") self.add_api_route("/sql", self.query_sql, methods=["POST"], summary="执行 SQL如果数据量大注意分页以免 OOM")
self.add_api_route("/new-friend", self.accept_new_friend, methods=["POST"], summary="通过好友申请") self.add_api_route("/new-friend", self.accept_new_friend, methods=["POST"], summary="通过好友申请")
self.add_api_route("/chatroom-member", self.add_chatroom_members, methods=["POST"], summary="添加群成员") self.add_api_route("/chatroom-member", self.add_chatroom_members, methods=["POST"], summary="添加群成员")
@ -156,13 +156,13 @@ class Http(FastAPI):
def send_text( def send_text(
self, msg: str = Body(description="要发送的消息,换行用\\n表示"), self, msg: str = Body(description="要发送的消息,换行用\\n表示"),
receiver: str = Body("filehelper", description="消息接收者roomid 或者 wxid"), receiver: str = Body("filehelper", description="消息接收者roomid 或者 wxid"),
aters: str = Body("", description="要 @ 的 wxid多个用逗号分隔@所有人 用 nofity@all")) -> dict: aters: str = Body("", description="要 @ 的 wxid多个用逗号分隔@所有人 用 notify@all")) -> dict:
"""发送文本消息可参考https://github.com/lich0821/WeChatRobot/blob/master/robot.py 里 sendTextMsg """发送文本消息可参考https://github.com/lich0821/WeChatRobot/blob/master/robot.py 里 sendTextMsg
Args: Args:
msg (str): 要发送的消息换行使用 `\\n`如果 @ 人的话需要带上跟 `aters` 里数量相同的 @ msg (str): 要发送的消息换行使用 `\\n`如果 @ 人的话需要带上跟 `aters` 里数量相同的 @
receiver (str): 消息接收人wxid 或者 roomid receiver (str): 消息接收人wxid 或者 roomid
aters (str): @ wxid多个用逗号分隔`@所有人` 只需要 `nofity@all` aters (str): @ wxid多个用逗号分隔`@所有人` 只需要 `notify@all`
Returns: Returns:
int: 0 为成功其他失败 int: 0 为成功其他失败
@ -293,17 +293,19 @@ class Http(FastAPI):
def receive_transfer(self, def receive_transfer(self,
wxid: str = Body("wxid_xxxxxxxxxxxxx", description="转账消息里的发送人 wxid"), wxid: str = Body("wxid_xxxxxxxxxxxxx", description="转账消息里的发送人 wxid"),
transferid: str = Body("transferid", description="转账消息里的 transferid")) -> dict: transferid: str = Body("transferid", description="转账消息里的 transferid"),
transactionid: str = Body("transactionid", description="转账消息里的 transactionid")) -> dict:
"""接收转账 """接收转账
Args: Args:
wxid (str): 转账消息里的发送人 wxid wxid (str): 转账消息里的发送人 wxid
transferid (str): 转账消息里的 transferid transferid (str): 转账消息里的 transferid
transactionid (str): 转账消息里的 transactionid
Returns: Returns:
int: 1 为成功其他失败 int: 1 为成功其他失败
""" """
ret = self.wcf.receive_transfer(wxid, transferid) ret = self.wcf.receive_transfer(wxid, transferid, transactionid)
return {"status": ret, "message": "成功"if ret == 1 else "失败"} return {"status": ret, "message": "成功"if ret == 1 else "失败"}
def decrypt_image(self, def decrypt_image(self,

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
__version__ = "39.0.0.0a2" __version__ = "39.0.0.0a3"
import atexit import atexit
import base64 import base64
@ -236,7 +236,7 @@ class Wcf():
Args: Args:
msg (str): 要发送的消息换行使用 `\\n`如果 @ 人的话需要带上跟 `aters` 里数量相同的 @ msg (str): 要发送的消息换行使用 `\\n`如果 @ 人的话需要带上跟 `aters` 里数量相同的 @
receiver (str): 消息接收人wxid 或者 roomid receiver (str): 消息接收人wxid 或者 roomid
aters (str): @ wxid多个用逗号分隔`@所有人` 只需要 `nofity@all` aters (str): @ wxid多个用逗号分隔`@所有人` 只需要 `notify@all`
Returns: Returns:
int: 0 为成功其他失败 int: 0 为成功其他失败

View File

@ -6,7 +6,7 @@
#define SUPPORT_VERSION L"3.9.2.23" #define SUPPORT_VERSION L"3.9.2.23"
WxCalls_t wxCalls = { WxCalls_t wxCalls = {
0x2FFD638, // Login Status 0x2FFD638, // Login Status
{ 0x2FFD4E8, 0x2FFD590, 0x2FFD500, 0x30238CC }, // User Info: wxid, nickname, mobile, home { 0x2FFD484, 0x2FFD590, 0x2FFD500, 0x30238CC }, // User Info: wxid, nickname, mobile, home
{ 0x768140, 0xCE6C80, 0x756960 }, // Send Message { 0x768140, 0xCE6C80, 0x756960 }, // Send Message
/* Receive Message: /* Receive Message:
Hook, call, type, self, id, msgXml, roomId, wxId, content, thumb, extra */ Hook, call, type, self, id, msgXml, roomId, wxId, content, thumb, extra */