diff options
| author | 2022-09-16 17:42:10 +0100 | |
|---|---|---|
| committer | 2022-09-16 17:42:10 +0100 | |
| commit | 32913523c0e34a91b621f6304ae95f8ba0728e14 (patch) | |
| tree | dc8a25910159b8dcabd722b1035041b2db253f0b | |
| parent | fix typo in docstrings (diff) | |
replace .isdigit predicate with a try except block
| -rw-r--r-- | bot/exts/info/information.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index 27a7b501d..b66c68f87 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -529,9 +529,9 @@ class Information(Cog): keywords, rules = [], [] for word in args: - if word.isdigit(): + try: rules.append(int(word)) - else: + except ValueError: keywords.append(word.lower()) if not rules and not keywords: |