tjc-sdk
Version:
TIANJI IM SDK
2 lines (1 loc) • 739 B
JavaScript
import t from"./groupNotification.js";import{MessageContentType as s}from"../messageContentType.js";import e from"../../client/tjc.js";class i extends t{operator;muteType;constructor(t,e){super(s.MuteGroup_Notification),this.operator=t,this.muteType=e}formatNotification(t){let s=this.fromSelf?"您":e.getGroupMemberDisplayName(this.groupId,this.operator);return s+=0===this.muteType?" 关闭了全员禁言":" 开启了全员禁言",s}encode(){let t=super.encode(),s={g:this.groupId,o:this.operator,n:this.muteType+""};return t.binaryContent=e.utf8_to_b64(JSON.stringify(s)),t}decode(t){super.decode(t);let s=JSON.parse(e.b64_to_utf8(t.binaryContent));this.groupId=s.g,this.operator=s.o,this.muteType=parseInt(s.n)}}export{i as default};