forked from sopel-irc/sopel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change makes ".xkcd" module more robust:
- don't allow negative numbers which accesses a comic number lower than 0 - don't allow the 0th comic when randomly checked - allow also a "+" and "#" as a sign - don't show an error when accessing sopel-irc#404 - don't show an error when no search.google_search() returned None
- Loading branch information
Showing
1 changed file
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you're going to use regex, can I suggest
r'^#?([+-]?\d+)$'
? this way you dont have to branch for the sign, it just gets included in group(1) automatically.