Changed the way mcitems limits stuff
This commit is contained in:
parent
c06012ffcd
commit
ebfb6bd809
|
@ -58,17 +58,21 @@ def itemid(input, reply=None):
|
||||||
results = []
|
results = []
|
||||||
|
|
||||||
for id, name in ids:
|
for id, name in ids:
|
||||||
if input == id or input in name.lower():
|
if input == id:
|
||||||
|
results = ["\x02[%s]\x02 %s" % (id, name)]
|
||||||
|
break
|
||||||
|
elif input in name.lower():
|
||||||
results.append("\x02[%s]\x02 %s" % (id, name))
|
results.append("\x02[%s]\x02 %s" % (id, name))
|
||||||
|
|
||||||
if not len(results):
|
if not len(results):
|
||||||
reply("error: No matches found.")
|
reply("No matches found.")
|
||||||
|
return
|
||||||
|
|
||||||
|
if len(results) > 12:
|
||||||
|
reply("There are too many options, please narrow your search. (%s)" % len(results))
|
||||||
return
|
return
|
||||||
|
|
||||||
out = ", ".join(results)
|
out = ", ".join(results)
|
||||||
|
|
||||||
if len(out) > 200:
|
|
||||||
out = out[:out.rfind(' ')] + '...'
|
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
@ -87,11 +91,11 @@ def recipe(input, reply=None):
|
||||||
results.append(recipe.line)
|
results.append(recipe.line)
|
||||||
|
|
||||||
if not len(results):
|
if not len(results):
|
||||||
reply("error: no matches found.")
|
reply("No matches found.")
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(results) > 3:
|
if len(results) > 3:
|
||||||
reply("error: too many results (%s)" % len(results))
|
reply("There are too many options, please narrow your search. (%s)" % len(results))
|
||||||
return
|
return
|
||||||
|
|
||||||
for result in results:
|
for result in results:
|
||||||
|
|
Reference in a new issue