Impl AddChatrootMembers
This commit is contained in:
+6
-1
@@ -51,7 +51,12 @@ def main():
|
||||
LOG.info(f"Tables:\n{wcf.get_tables('db')}")
|
||||
LOG.info(f"Results:\n{wcf.query_sql('MicroMsg.db', 'SELECT * FROM Contact LIMIT 1;')}")
|
||||
|
||||
# wcf.accept_new_friend("v3", "v4") # 需要真正的 V3、V4 信息
|
||||
# 需要真正的 V3、V4 信息
|
||||
# wcf.accept_new_friend("v3", "v4")
|
||||
|
||||
# 填写正确的群 ID 和成员 wxid
|
||||
# ret = wcf.add_chatroom_members("chatroom id", "wxid1,wxid2,wxid3,...")
|
||||
# LOG.info(f"add_chatroom_members: {ret}")
|
||||
|
||||
# 一直运行
|
||||
wcf.keep_running()
|
||||
|
||||
@@ -70,7 +70,7 @@ class Wcf():
|
||||
cmd = f"{WCF_ROOT}/wcf.exe start {'debug' if debug else ''}"
|
||||
if os.system(cmd) != 0:
|
||||
self.LOG.error("初始化失败!")
|
||||
return
|
||||
exit(-1)
|
||||
|
||||
# 连接 RPC
|
||||
self.cmd_socket = pynng.Pair1() # Client --> Server,发送消息
|
||||
@@ -358,3 +358,12 @@ class Wcf():
|
||||
friends.append(cnt)
|
||||
|
||||
return friends
|
||||
|
||||
def add_chatroom_members(self, roomid: str, wxids: str) -> int:
|
||||
"""添加群成员"""
|
||||
req = wcf_pb2.Request()
|
||||
req.func = wcf_pb2.FUNC_ADD_ROOM_MEMBERS # FUNC_ADD_ROOM_MEMBERS
|
||||
req.m.roomid = roomid
|
||||
req.m.wxids = wxids
|
||||
rsp = self._send_request(req)
|
||||
return rsp.status
|
||||
|
||||
Reference in New Issue
Block a user