xkcdbot
xkcdbot copied to clipboard
Added functionality for replying to submissions
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.
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!