WeChatApi


群聊发送消息并且@指定群成员

<p><strong>简要描述:</strong></p> <ul> <li>群聊发送消息并且@指定群成员</li> </ul> <p><strong>请求URL:</strong></p> <ul> <li><code>http://127.0.0.1:8989/api</code></li> </ul> <p><strong>请求方式:</strong></p> <ul> <li>POST</li> </ul> <p><strong>JSON参数:</strong></p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">是否必选</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">type</td> <td style="text-align: left;">是</td> <td style="text-align: left;">int</td> <td style="text-align: left;">消息类型</td> </tr> <tr> <td style="text-align: left;">chat_room_id</td> <td style="text-align: left;">是</td> <td style="text-align: left;">string</td> <td style="text-align: left;">群ID</td> </tr> <tr> <td style="text-align: left;">at_list</td> <td style="text-align: left;">是</td> <td style="text-align: left;">array</td> <td style="text-align: left;">@人的微信ID列表</td> </tr> <tr> <td style="text-align: left;">msg</td> <td style="text-align: left;">是</td> <td style="text-align: left;">string</td> <td style="text-align: left;">文本消息</td> </tr> <tr> <td style="text-align: left;">is_custom</td> <td style="text-align: left;">否</td> <td style="text-align: left;">int</td> <td style="text-align: left;">0:默认@位置&lt;/br&gt;1:自行指定@位置</td> </tr> </tbody> </table> <p><strong>发送示例【方式1】:</strong></p> <ul> <li>该方式只需要传递文本内容,【@昵称】会自动添加到文本内容的头部</li> </ul> <pre><code class="language-json">{     &amp;quot;type&amp;quot;: 13, &amp;quot;chat_room_id&amp;quot;: &amp;quot;xxxxx@chatroom&amp;quot;, &amp;quot;at_list&amp;quot;: [ &amp;quot;wxid_xxxxx1&amp;quot;, &amp;quot;wxid_xxxxx2&amp;quot; ], &amp;quot;msg&amp;quot;: &amp;quot;你俩看一下&amp;quot; }</code></pre> <p><strong>发送示例【方式2】:</strong></p> <ul> <li>当传递了 <code>is_custom</code> 且值为1时,将不再默认添加【@昵称】到文本头部</li> <li>此时需要你自行指定【@昵称】的位置,可搭配《批量查询群成员的群昵称》《本地查询好友信息》来获取群昵称或微信昵称</li> <li>注意1:【@昵称】的数量要跟 <code>at_list</code> 中的微信ID数量相等,否则@将失效</li> <li>注意2:【@昵称】后必须有一个“\u2005”,它是unicode编码的空格,否则@将失效</li> </ul> <pre><code class="language-json">{     &amp;quot;type&amp;quot;: 13, &amp;quot;chat_room_id&amp;quot;: &amp;quot;xxxxx@chatroom&amp;quot;, &amp;quot;at_list&amp;quot;: [ &amp;quot;wxid_xxxxx1&amp;quot;, &amp;quot;wxid_xxxxx2&amp;quot; ], &amp;quot;msg&amp;quot;: &amp;quot;@张三\u2005你看上面 @李四\u2005你看下面&amp;quot;, &amp;quot;is_custom&amp;quot;: 1 }</code></pre>

页面列表

ITEM_HTML