【问题标题】:How to send an image in direct message?如何在直接消息中发送图像?
【发布时间】:2016-05-20 21:05:35
【问题描述】:

我正在尝试使用 python + tweepy 在直接消息中发送图像,但没有运气。 它显示为传入消息中的链接。

imgurl = 'https://t.co/***'
api.send_direct_message(screen_name='username',text=' '+imgurl)

你能建议吗? 官方 Twitter API 也没有为我提供帮助。

【问题讨论】:

    标签: python twitter tweepy


    【解决方案1】:

    目前,您正在发送一个链接。字面意思是文本是 URL 的状态消息。

    很遗憾,Twitter don't provide API access for uploading images via DM

    如果您能够使用 Twitter 的私有 API,您应该能够将 media_id 附加到您的 DM。但除此之外,你运气不好。

    对不起。

    【讨论】:

      猜你喜欢
      • 2023-01-12
      • 1970-01-01
      • 1970-01-01
      • 2016-12-22
      • 2012-08-24
      • 2011-05-08
      • 2019-05-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多