joeyvanlierop / xkcdbot

A reddit bot that automatically links xkcd comics in the /r/xkcd subreddit 🤖
MIT License
37 stars 20 forks source link

Handle range of comics #6

Closed joeyvanlierop closed 4 years ago

joeyvanlierop commented 4 years ago

Implement the ability to comment "!585...590" and return the comics with id's 585, 586, 587, 588, 589, 560. More information can be found here.

cj81499 commented 4 years ago

Should there be a limit on the number of comics in the range? It seems like a bad idea to let users request thousands of comics.

joeyvanlierop commented 4 years ago

The bot currently truncates the list of responses in this line and also has a break statement in this line, however it might be a good idea to implement another check/break within the method that would handle a range of comics.

stefanosporiazis commented 4 years ago

@joeyvanlierop I just started working on this. What should our approach be for ranges that are entered backwards? e.g. "!590...550"

joeyvanlierop commented 4 years ago

It's up to you. I don't think it would be too difficult to make it work in reverse, however if the solution becomes convoluted or very unintuitive, feel free to ignore it.

Note: There is currently an open pull request that worked on this. Check it out here if you want some guidance.

joeyvanlierop commented 4 years ago

Solved in #24