UQComputingSociety / uqcsbot-slack

:mortar_board: UQCSbot: our friendly little Slack bot
https://slack.uqcs.org.au
MIT License
55 stars 44 forks source link

Ensure all things posted by uqcsbot are comics, fixes #482 #497

Closed kumar-ish closed 4 years ago

kumar-ish commented 5 years ago

As in title. This probably isn't the most efficient way to do this since the string slicing is hard-coded, but I doubt that would be a problem (unless xkcd decides to change what they've done for the last x number of years). Fixes #482

bradleysigma commented 5 years ago

Have you considered regex? r"https://xkcd\.com/\d+/"

nicklambourne commented 5 years ago

Have you considered regex? r"https://xkcd\.com/\d+/"

This would also work, with re.match()

kumar-ish commented 4 years ago

Requested changes have been done (after approximately too long)