Nakilon / reddit_bot

Simple Reddit bot in Ruby
MIT License
11 stars 5 forks source link

Example of posting images in a post submit call? #22

Closed ishields closed 1 year ago

ishields commented 2 years ago

Hello! Love this gem! I'm looking to send an image url when using the post submit call. Are there any examples of this?

Currently doing something like this: bot.json :post, '/api/submit', { sr: subreddit_name, kind: 'self', title: title, text: message, url: url } But would like to also send {image_url: 'http://example/myimage.jpg'} and have that be used as the posts image. Any ideas on how this could be done or in what example I should look?

Nakilon commented 2 years ago

Oh I wish Github was sending email notifications on new Issues. I had no idea about this.

Doesn't this work for you? https://github.com/Nakilon/reddit_bot/blob/3f28eeb5b6396f1df149fcb4a52043fc3658b5f4/examples/largeimages/main.rb#L145-L152 I.e. remove text, change the kind to link. Or am I missing something?