diff options
author | jomo <github@jomo.tv> | 2014-07-27 05:28:31 +0200 |
---|---|---|
committer | jomo <github@jomo.tv> | 2014-07-27 05:28:31 +0200 |
commit | e04053e46f14226859199b40c9a5c67bdaa4f260 (patch) | |
tree | 8db014f26c3049223cdfc99acd908ab4631ac96f /saylol.py | |
parent | 2a1c2f391973d9196835b482655a3947462cb328 (diff) |
add /lol search <text>
Diffstat (limited to 'saylol.py')
-rw-r--r-- | saylol.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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))) +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") def on_lol_command(sender, args): 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)): 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": if sender.hasPermission("utils.lol.modify"): plugin_header(sender, "SayLol") |