wechaty / puppet-supports

Wechaty Puppet Services (WPS)
https://wechaty.js.org/docs/puppet-services/
Apache License 2.0
31 stars 3 forks source link

如何使用workpro的publish方法发朋友圈 #330

Closed fangkunhhh closed 8 months ago

fangkunhhh commented 8 months ago

image 在官方文档中看到支持API方式发送朋友圈,但没有看到相关的案例,请问能提供一份简易的DEMO嘛,十分感谢🙏

hcfw007 commented 8 months ago

请使用 @juzi scope 的wechaty包并参考这个文档:https://juzihudong.feishu.cn/wiki/wikcnO7MyGoTUtlRTUnw708TRah

hcfw007 commented 8 months ago
const builder = bot.Post.builder()

builder.add('这是一条朋友圈')
builder.add(FileBox.fromUrl('https://www.jiluai.com/public/photo/e3/09/709e3b145465ae9f1ee9bc763a78bcb8.jpg'))
builder.type(Post.Moment)
const post = await builder.build()

const publishedPost = bot.publish(post) // 返回一个postServer对象
su-chang commented 8 months ago

暂无反馈,关闭该issue。