MCPcopy
hub / github.com/wechatpy/wechatpy / send_link

Method send_link

wechatpy/client/api/message.py:220–242  ·  view source on GitHub ↗

发送图文消息(单图文) 详情请参考 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-message/customerServiceMessage.send.html#method-http :param user_id: 用户 ID 。 就是你收到的 `Message` 的 source :param article: :return: 返回的 JSON 数据包

(self, user_id, article, account=None)

Source from the content-addressed store, hash-verified

218 return self._send_custom_message(data, account=account)
219
220 def send_link(self, user_id, article, account=None):
221 """
222 发送图文消息(单图文)
223
224 详情请参考
225 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-message/customerServiceMessage.send.html#method-http
226
227 :param user_id: 用户 ID 。 就是你收到的 `Message` 的 source
228 :param article:
229 :return: 返回的 JSON 数据包
230 """
231
232 data = {
233 'touser': user_id,
234 'msgtype': 'link',
235 'link': {
236 'title': article['title'],
237 'description': article['description'],
238 'url': article['url'],
239 'thumb_url': article.get('image', article.get('picurl', article.get('thumb_url'))),
240 }
241 }
242 return self._send_custom_message(data, account=account)
243
244 def send_card(self, user_id, card_id, card_ext=None, account=None):
245 """

Callers

nothing calls this directly

Calls 2

_send_custom_messageMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected