Skip to content

Commit b5eda82

Browse files
authored
Merge pull request CloudBotIRC#254 from linuxdaemon/gonzobot+fix-urban-dictionary
Update no definition test in urban.py
2 parents de19a04 + ecf253c commit b5eda82

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

plugins/urban.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ def urban(text, reply):
4242
raise
4343

4444
page = request.json()
45-
46-
if page['result_type'] == 'no_results':
47-
return 'Not found.'
4845
else:
4946
# get a random definition!
5047
try:
@@ -59,6 +56,9 @@ def urban(text, reply):
5956

6057
definitions = page['list']
6158

59+
if not definitions:
60+
return 'Not found.'
61+
6262
if id_num:
6363
# try getting the requested definition
6464
try:

0 commit comments

Comments
 (0)