add /lol search <text>
This commit is contained in:
12
saylol.py
12
saylol.py
@@ -49,6 +49,12 @@ def print_lol(sender, lid):
|
|||||||
msg(sender, "&cYou can use SayLol again in &a%s seconds!" % int(timeout + 1 - (time() - last_msg)))
|
msg(sender, "&cYou can use SayLol again in &a%s seconds!" % int(timeout + 1 - (time() - last_msg)))
|
||||||
|
|
||||||
|
|
||||||
|
def search_lols(sender, keyword):
|
||||||
|
for i, lol in enumerate(lols):
|
||||||
|
if keyword in lol:
|
||||||
|
msg(sender, "&a%s: &e%s" % (str(i).rjust(3), lol))
|
||||||
|
|
||||||
|
|
||||||
@hook.command("lol")
|
@hook.command("lol")
|
||||||
def on_lol_command(sender, args):
|
def on_lol_command(sender, args):
|
||||||
cmd = args[0] if len(args) > 0 else None
|
cmd = args[0] if len(args) > 0 else None
|
||||||
@@ -74,6 +80,12 @@ def on_lol_command(sender, args):
|
|||||||
for i in range(len(lols)):
|
for i in range(len(lols)):
|
||||||
msg(sender, "&a%s: &e%s" % (str(i).rjust(3), lols[i]))
|
msg(sender, "&a%s: &e%s" % (str(i).rjust(3), lols[i]))
|
||||||
|
|
||||||
|
elif cmd == "search":
|
||||||
|
if sender.hasPermission("utils.lol.search"):
|
||||||
|
search_lols(sender, " ".join(args[1:]))
|
||||||
|
else:
|
||||||
|
noperm(sender)
|
||||||
|
|
||||||
elif cmd == "add":
|
elif cmd == "add":
|
||||||
if sender.hasPermission("utils.lol.modify"):
|
if sender.hasPermission("utils.lol.modify"):
|
||||||
plugin_header(sender, "SayLol")
|
plugin_header(sender, "SayLol")
|
||||||
|
|||||||
Reference in New Issue
Block a user