mirror of
https://github.com/smallevilbeast/ntchat.git
synced 2025-09-04 20:06:06 +08:00
添加群管理功能
This commit is contained in:
parent
311a281d82
commit
bfeeba7abf
|
@ -35,3 +35,16 @@ MT_RECV_SYSTEM_MSG = 11058
|
||||||
MT_RECV_REVOKE_MSG = 11059
|
MT_RECV_REVOKE_MSG = 11059
|
||||||
MT_RECV_OTHER_MSG = 11060
|
MT_RECV_OTHER_MSG = 11060
|
||||||
MT_RECV_OTHER_APP_MSG = 11061
|
MT_RECV_OTHER_APP_MSG = 11061
|
||||||
|
|
||||||
|
# 好友操作
|
||||||
|
MT_ACCEPT_FRIEND_MSG = 11065
|
||||||
|
|
||||||
|
# 群操作类
|
||||||
|
MT_CREATE_ROOM_MSG = 11068
|
||||||
|
MT_INVITE_TO_ROOM_MSG = 11069
|
||||||
|
MT_INVITE_TO_ROOM_REQ_MSG = 11070
|
||||||
|
MT_DEL_ROOM_MEMBER_MSG = 11071
|
||||||
|
MT_MOD_ROOM_NAME_MSG = 11072
|
||||||
|
MT_MOD_ROOM_NOTICE_MSG = 11073
|
||||||
|
MT_QUIT_DEL_ROOM_MSG = 11077
|
||||||
|
|
||||||
|
|
|
@ -247,10 +247,81 @@ class WeChat:
|
||||||
}
|
}
|
||||||
return self.__send(wx_type.MT_SEND_VIDEO_MSG, data)
|
return self.__send(wx_type.MT_SEND_VIDEO_MSG, data)
|
||||||
|
|
||||||
# 发送gif
|
|
||||||
def send_gif(self, to_wxid, file):
|
def send_gif(self, to_wxid, file):
|
||||||
|
"""
|
||||||
|
发送gif:
|
||||||
|
"""
|
||||||
data = {
|
data = {
|
||||||
'to_wxid': to_wxid,
|
'to_wxid': to_wxid,
|
||||||
'file': file
|
'file': file
|
||||||
}
|
}
|
||||||
return self.__send(wx_type.MT_SEND_GIF_MSG, data)
|
return self.__send(wx_type.MT_SEND_GIF_MSG, data)
|
||||||
|
|
||||||
|
def accept_friend_request(self, encryptusername: str, ticket: str, scene: int):
|
||||||
|
"""
|
||||||
|
同意加好友请求
|
||||||
|
"""
|
||||||
|
data = {
|
||||||
|
"encryptusername": encryptusername,
|
||||||
|
"ticket": ticket,
|
||||||
|
"scene": scene
|
||||||
|
}
|
||||||
|
return self.__send_sync(wx_type.MT_ACCEPT_FRIEND_MSG, data)
|
||||||
|
|
||||||
|
def create_room(self, member_list: List[str]):
|
||||||
|
"""
|
||||||
|
创建群
|
||||||
|
"""
|
||||||
|
return self.__send(wx_type.MT_CREATE_ROOM_MSG, member_list)
|
||||||
|
|
||||||
|
def add_room_member(self, room_wxid: str, member_list: List[str]):
|
||||||
|
"""
|
||||||
|
添加好友入群
|
||||||
|
"""
|
||||||
|
data = {
|
||||||
|
"room_wxid": room_wxid,
|
||||||
|
"member_list": member_list
|
||||||
|
}
|
||||||
|
return self.__send_sync(wx_type.MT_INVITE_TO_ROOM_MSG, data)
|
||||||
|
|
||||||
|
def invite_room_member(self, room_wxid: str, member_list: List[str]):
|
||||||
|
"""
|
||||||
|
邀请好友入群
|
||||||
|
"""
|
||||||
|
data = {
|
||||||
|
"room_wxid": room_wxid,
|
||||||
|
"member_list": member_list
|
||||||
|
}
|
||||||
|
return self.__send_sync(wx_type.MT_INVITE_TO_ROOM_REQ_MSG, data)
|
||||||
|
|
||||||
|
def del_room_member(self, room_wxid: str, member_list: List[str]):
|
||||||
|
"""
|
||||||
|
删除群成员
|
||||||
|
"""
|
||||||
|
data = {
|
||||||
|
"room_wxid": room_wxid,
|
||||||
|
"member_list": member_list
|
||||||
|
}
|
||||||
|
return self.__send_sync(wx_type.MT_DEL_ROOM_MEMBER_MSG, data)
|
||||||
|
|
||||||
|
def modify_room_name(self, room_wxid: str, name: str):
|
||||||
|
"""
|
||||||
|
修改群名
|
||||||
|
"""
|
||||||
|
data = {
|
||||||
|
"room_wxid": room_wxid,
|
||||||
|
"name": name
|
||||||
|
}
|
||||||
|
return self.__send_sync(wx_type.MT_MOD_ROOM_NAME_MSG, data)
|
||||||
|
|
||||||
|
def modify_room_notice(self, room_wxid: str, notice: str):
|
||||||
|
"""
|
||||||
|
修改群公告
|
||||||
|
"""
|
||||||
|
data = {
|
||||||
|
"room_wxid": room_wxid,
|
||||||
|
"notice": notice
|
||||||
|
}
|
||||||
|
return self.__send_sync(wx_type.MT_MOD_ROOM_NOTICE_MSG, data)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user