xkcdbot icon indicating copy to clipboard operation
xkcdbot copied to clipboard

Added functionality for replying to submissions

Open stefanos-poriazis opened this issue 5 years ago • 1 comments

Changes:

  • Added a submission stream and another call to run_stream
  • New method handle_submission Works the same way as handle_comment
  • New method valid_submission Again works the same way as valid_comment, only it doesn't check if the submission was posted by the bot since the bot only comments
  • Modified handle_username_mention to make it work for submissions Reddit for some reason doesn't notify for username mentions in submissions, so I don't think the bot can find submissions outside of the subreddits it's monitoring
  • New method get_responses_for_comic_ids Basically took the block of code that iterated over the comic_ids to get the responses and made it into a method
  • New method get_responses_for_comic_titles Same as above

I intended to add tests for the new methods but it's kind of complicated because I have to make a mock submission and a mock response or something, so I'm still trying to work those out.

stefanos-poriazis avatar Jun 21 '20 06:06 stefanos-poriazis

This looks really great! I'll see if I can put something together for the tests, however I have been quite busy recently so unfortunately I cannot give an estimate. Thanks for the fantastic contribution!

joeyvanlierop avatar Jun 23 '20 15:06 joeyvanlierop