Tweaked plugins/suggest.py and plugins/slogan.py
This commit is contained in:
parent
c331e0adf6
commit
2755e8b978
1 changed files with 3 additions and 3 deletions
|
@ -15,7 +15,7 @@ def suggest(inp, inp_unstripped=''):
|
||||||
num, inp = m.groups()
|
num, inp = m.groups()
|
||||||
num = int(num)
|
num = int(num)
|
||||||
if num > 10:
|
if num > 10:
|
||||||
return 'can only get first ten suggestions'
|
return 'I can only get first ten suggestions.'
|
||||||
else:
|
else:
|
||||||
num = 0
|
num = 0
|
||||||
|
|
||||||
|
@ -23,10 +23,10 @@ def suggest(inp, inp_unstripped=''):
|
||||||
page_json = page.split('(', 1)[1][:-1]
|
page_json = page.split('(', 1)[1][:-1]
|
||||||
suggestions = json.loads(page_json)[1]
|
suggestions = json.loads(page_json)[1]
|
||||||
if not suggestions:
|
if not suggestions:
|
||||||
return 'no suggestions found'
|
return 'No suggestions found :('
|
||||||
if num:
|
if num:
|
||||||
if len(suggestions) + 1 <= num:
|
if len(suggestions) + 1 <= num:
|
||||||
return 'only got %d suggestions' % len(suggestions)
|
return 'I only got %d suggestions.' % len(suggestions)
|
||||||
out = suggestions[num - 1]
|
out = suggestions[num - 1]
|
||||||
else:
|
else:
|
||||||
out = random.choice(suggestions)
|
out = random.choice(suggestions)
|
||||||
|
|
Reference in a new issue