File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,10 @@ OP == 0 取消置顶
215215
216216OP == 1 置顶
217217
218+ ##### bot.updateRemarkName(UserName, RemarkName)
219+
220+ 设置联系人备注或标签
221+
218222## 实例事件
219223
220224##### uuid
Original file line number Diff line number Diff line change @@ -885,6 +885,33 @@ export default class WechatCore {
885885 } )
886886 }
887887
888+ updateRemarkName ( UserName , RemarkName ) {
889+ return Promise . resolve ( ) . then ( ( ) => {
890+ let params = {
891+ pass_ticket : this . PROP . passTicket ,
892+ 'lang' : 'zh_CN'
893+ }
894+ let data = {
895+ BaseRequest : this . getBaseRequest ( ) ,
896+ CmdId : 2 ,
897+ RemarkName : RemarkName ,
898+ UserName : UserName
899+ }
900+ return this . request ( {
901+ method : 'POST' ,
902+ url : this . CONF . API_webwxoplog ,
903+ params : params ,
904+ data : data
905+ } ) . then ( res => {
906+ let data = res . data
907+ assert . equal ( data . BaseResponse . Ret , 0 , res )
908+ } )
909+ } ) . catch ( err => {
910+ debug ( err )
911+ throw new Error ( '设置用户标签失败' )
912+ } )
913+ }
914+
888915 getBaseRequest ( ) {
889916 return {
890917 Uin : parseInt ( this . PROP . uin ) ,
You can’t perform that action at this time.
0 commit comments