From 70d5e2fc80afc2a4b74879115141d4bcaddfee2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Wed, 31 Dec 2025 19:46:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E8=A8=80=E5=85=B3=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Tencent.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/application/api/model/Tencent.php b/application/api/model/Tencent.php index 0bba6822..699a8c9a 100644 --- a/application/api/model/Tencent.php +++ b/application/api/model/Tencent.php @@ -1081,4 +1081,24 @@ class Tencent extends Model return true; } + //禁言 + public function mute_member($rid, $uida, $time=3600){ + $config = get_system_config(); + $tencentyun_im_appid = $config['tencentyun_im_appid']; + $im_admin = 'administrator'; + $admin_sig = $this->tencent_user_sig_info($im_admin); + $rand = rand(111111111,9999999999); + $postUrl = 'https://console.tim.qq.com/v4/live_engine_http_srv/mute_member?sdkappid='.$tencentyun_im_appid.'&identifier='.$im_admin.'&usersig='.$admin_sig.'&random='.$rand.'&contenttype=json'; + $curlPost['RoomId'] = $rid; + $curlPost['MemberList_Account'] = $uida; + $curlPost['MuteTime'] = $time; + $curlPost = json_encode($curlPost); + $reslut = $this->tencent_post_url($postUrl, $curlPost); + if($reslut['ActionStatus'] == 'OK'){ + return ['code' => 1, 'msg' => '操作成功', 'data' => null]; + }else{ + return ['code' => 0, 'msg' => $reslut['ErrorCode'], 'data' => null]; + } + } + }