trait TeamTrait (View source)

群组功能(高级群)

Methods

array
teamCreate(string $tname, string $owner, string $icon, array $members, string $custom = '', string $msg = 'msg', string $announcement = '', string $intro = '', int $mAgree = null, int $joinMode = null, int $beInviteMode = null, int $inviteMode = null, int $uptInfoMode = null, int $upCustomMode = null)

创建群组

array
teamAdd(string $tid, string $owner, array $members, string $msg, int $mAgree = null, string $attach = '')

拉人入群

array|bool
teamKick(string $tid, string $owner, string $member, string $attach)

踢人出群

array|bool
teamRemove(string $tid, string $owner)

解散群

array|bool
teamUpdate(string $tid, string $tname, string $owner, string $icon = '', string $custom = '', string $announcement = '', string $intro = '', int $joinMode = null, int $beInviteMode = null, int $inviteMode = null, int $uptInfoMode = null, int $upCustomMode = null)

更新群组

array
teamQuery(array $tids, int $ope = null)

群信息与成员列表查询 高级群信息与成员列表查询,一次最多查询30个群相关的信息,跟据ope参数来控制是否带上群成员列表; 查询群成员会稍微慢一些,所以如果不需要群成员列表可以只查群信息; 此接口受频率控制,某个应用一分钟最多查询30次,超过会返回416,并且被屏蔽一段时间; 群成员的群列表信息中增加管理员成员admins的返回

array
teamQueryDetail(string $tid)

获取群组详细信息 查询指定群的详细信息(群信息+成员详细信息)

array
teamGetMarkReadInfo(string $tid, string $msgid, string $fromAccid, bool $snapshot = false)

获取群组已读消息的已读详情信息

array|bool
TeamChangeOwner(string $tid, string $owner, string $newOwner, int $leave = null)

移交群主 转换群主身份; 群主可以选择离开此群,还是留下来成为普通成员。

array|bool
teamAddManager(string $tid, string $owner, array $members)

任命管理员 提升普通成员为群管理员,可以批量,但是一次添加最多不超过10个人。

array|bool
teamRemoveManager(string $tid, string $owner, array $members)

移除管理员 解除管理员身份,可以批量,但是一次解除最多不超过10个人

array
teamJoinTeams(string $accid)

获取某个用户所加入高级群的群信息

array|bool
teamUpdateTeamNick(string $tid, string $owner, string $accid, string $nick, string $custom = '')

修改群昵称

array|bool
teamMuteTeam(string $tid, string $accid, int $ope)

修改消息提醒开关

array|bool
teamMuteTlist(string $tid, string $owner, string $accid, int $mute = 0)

禁言群成员

array|bool
teamLeave(string $tid, string $accid)

主动退群

array|bool
teamMuteTlistAll(string $tid, string $owner, int $mute = 0)

将群组整体禁言

array
teamListTeamMute(string $tid, string $owner)

获取群组禁言列表

Details

array teamCreate(string $tname, string $owner, string $icon, array $members, string $custom = '', string $msg = 'msg', string $announcement = '', string $intro = '', int $mAgree = null, int $joinMode = null, int $beInviteMode = null, int $inviteMode = null, int $uptInfoMode = null, int $upCustomMode = null)

创建群组

创建高级群,以邀请的方式发送给用户; custom 字段是给第三方的扩展字段,第三方可以基于此字段扩展高级群的功能,构建自己需要的群; 建群成功会返回tid,需要保存,以便于加人与踢人等后续操作; 每个用户可创建的群数量有限制,限制值由 IM 套餐的群组配置决定,可登录管理后台查看。

Parameters

string $tname 群名称,最大长度64字符
string $owner 群主用户帐号,最大长度32字符
string $icon 群头像,最大长度1024字符
array $members "aaa","bbb",一次最多拉200个成员
string $custom 自定义高级群扩展属性,第三方可以跟据此属性自定义扩展自己的群属性。(建议为json),最大长度1024字符
string $msg 邀请发送的文字,最大长度150字符
string $announcement 群公告,最大长度1024字符
string $intro 群描述,最大长度512字符
int $mAgree 管理后台建群时,0不需要被邀请人同意加入群,1需要被邀请人同意才可以加入群。其它会返回414
int $joinMode 群建好后,sdk操作时,0不用验证,1需要验证,2不允许任何人加入。其它返回414
int $beInviteMode 被邀请人同意方式,0-需要同意(默认),1-不需要同意。其它返回414
int $inviteMode 谁可以邀请他人入群,0-管理员(默认),1-所有人。其它返回414
int $uptInfoMode 谁可以修改群资料,0-管理员(默认),1-所有人。其它返回414
int $upCustomMode 谁可以更新群自定义属性,0-管理员(默认),1-所有人。其它返回414

Return Value

array $result 或 ['error'=>true,'message'=>$message]

array teamAdd(string $tid, string $owner, array $members, string $msg, int $mAgree = null, string $attach = '')

拉人入群

Parameters

string $tid 网易云通信服务器产生,群唯一标识,创建群时会返回,最大长度128字符
string $owner 群主用户帐号,最大长度32字符
array $members "aaa","bbb",一次最多拉200个成员
string $msg 邀请发送的文字,最大长度150字符
int $mAgree 管理后台建群时,0不需要被邀请人同意加入群,1需要被邀请人同意才可以加入群。其它会返回414
string $attach 自定义扩展字段,最大长度512

Return Value

array $result 或 ['error'=>true,'message'=>$message],如果邀请的人中存在加群数量超限的情况,会返回faccid

array|bool teamKick(string $tid, string $owner, string $member, string $attach)

踢人出群

Parameters

string $tid 网易云通信服务器产生,群唯一标识,创建群时会返回,最大长度128字符
string $owner 群主用户帐号,最大长度32字符
string $member 被移除人的accid,用户账号,最大长度字符
string $attach 自定义扩展字段,最大长度512

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array|bool teamRemove(string $tid, string $owner)

解散群

Parameters

string $tid 网易云通信服务器产生,群唯一标识,创建群时会返回,最大长度128字符
string $owner 群主用户帐号,最大长度32字符

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array|bool teamUpdate(string $tid, string $tname, string $owner, string $icon = '', string $custom = '', string $announcement = '', string $intro = '', int $joinMode = null, int $beInviteMode = null, int $inviteMode = null, int $uptInfoMode = null, int $upCustomMode = null)

更新群组

Parameters

string $tid 易云通信服务器产生,群唯一标识,创建群时会返回
string $tname 群名称,最大长度64字符
string $owner 群主用户帐号,最大长度32字符
string $icon 群头像,最大长度1024字符
string $custom 自定义高级群扩展属性,第三方可以跟据此属性自定义扩展自己的群属性。(建议为json),最大长度1024字符
string $announcement 群公告,最大长度1024字符
string $intro 群描述,最大长度512字符
int $joinMode 群建好后,sdk操作时,0不用验证,1需要验证,2不允许任何人加入。其它返回414
int $beInviteMode 被邀请人同意方式,0-需要同意(默认),1-不需要同意。其它返回414
int $inviteMode 谁可以邀请他人入群,0-管理员(默认),1-所有人。其它返回414
int $uptInfoMode 谁可以修改群资料,0-管理员(默认),1-所有人。其它返回414
int $upCustomMode 谁可以更新群自定义属性,0-管理员(默认),1-所有人。其它返回414

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array teamQuery(array $tids, int $ope = null)

群信息与成员列表查询 高级群信息与成员列表查询,一次最多查询30个群相关的信息,跟据ope参数来控制是否带上群成员列表; 查询群成员会稍微慢一些,所以如果不需要群成员列表可以只查群信息; 此接口受频率控制,某个应用一分钟最多查询30次,超过会返回416,并且被屏蔽一段时间; 群成员的群列表信息中增加管理员成员admins的返回

Parameters

array $tids 群id列表,如["3083","3084"]
int $ope 1表示带上群成员列表,0表示不带群成员列表,只返回群信息

Return Value

array $result['tinfos'] 或 ['error'=>true,'message'=>$message]

array teamQueryDetail(string $tid)

获取群组详细信息 查询指定群的详细信息(群信息+成员详细信息)

Parameters

string $tid 群id

Return Value

array $result['tinfos'] 或 ['error'=>true,'message'=>$message]

array teamGetMarkReadInfo(string $tid, string $msgid, string $fromAccid, bool $snapshot = false)

获取群组已读消息的已读详情信息

Parameters

string $tid
string $msgid
string $fromAccid
bool $snapshot

Return Value

array $result['data'] 或 ['error'=>true,'message'=>$message]

array|bool TeamChangeOwner(string $tid, string $owner, string $newOwner, int $leave = null)

移交群主 转换群主身份; 群主可以选择离开此群,还是留下来成为普通成员。

Parameters

string $tid 网易云通信服务器产生,群唯一标识,创建群时会返回,最大长度128字符
string $owner 群主用户帐号,最大长度32字符
string $newOwner 新群主帐号,最大长度32字符
int $leave 1:群主解除群主后离开群,2:群主解除群主后成为普通成员。其它414

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array|bool teamAddManager(string $tid, string $owner, array $members)

任命管理员 提升普通成员为群管理员,可以批量,但是一次添加最多不超过10个人。

Parameters

string $tid 群id
string $owner 群主用户accid
array $members 用户accid 数组

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array|bool teamRemoveManager(string $tid, string $owner, array $members)

移除管理员 解除管理员身份,可以批量,但是一次解除最多不超过10个人

Parameters

string $tid 群唯一标识,创建群时网易云通信服务器产生并返回
string $owner 群主 accid
array $members 用户accid 数组

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array teamJoinTeams(string $accid)

获取某个用户所加入高级群的群信息

Parameters

string $accid 要查询用户的accid

Return Value

array $result 或 ['error'=>true,'message'=>$message]

array|bool teamUpdateTeamNick(string $tid, string $owner, string $accid, string $nick, string $custom = '')

修改群昵称

Parameters

string $tid 群唯一标识,创建群时网易云通信服务器产生并返回
string $owner 群主 accid
string $accid 要修改群昵称的群成员 accid
string $nick accid 对应的群昵称,最大长度32字符
string $custom 自定义扩展字段,最大长度1024字节

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array|bool teamMuteTeam(string $tid, string $accid, int $ope)

修改消息提醒开关

Parameters

string $tid 群唯一标识,创建群时网易云通信服务器产生并返回
string $accid 要操作的群成员accid
int $ope 1:关闭消息提醒,2:打开消息提醒,其他值无效

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array|bool teamMuteTlist(string $tid, string $owner, string $accid, int $mute = 0)

禁言群成员

Parameters

string $tid 群唯一标识,创建群时网易云通信服务器产生并返回
string $owner 要操作的群成员accid
string $accid 禁言对象的accid
int $mute 1-禁言,0-解禁

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array|bool teamLeave(string $tid, string $accid)

主动退群

Parameters

string $tid 群唯一标识,创建群时网易云通信服务器产生并返回
string $accid 禁言对象的accid

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array|bool teamMuteTlistAll(string $tid, string $owner, int $mute = 0)

将群组整体禁言

Parameters

string $tid 群唯一标识,创建群时网易云通信服务器产生并返回
string $owner 要操作的群成员accid
int $mute 1-禁言,0-解禁

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array teamListTeamMute(string $tid, string $owner)

获取群组禁言列表

Parameters

string $tid 群唯一标识,创建群时网易云通信服务器产生并返回
string $owner 群主的accid

Return Value

array $result['mutes'] 或 ['error'=>true,'message'=>$message]