diff --git a/plugins/flirt.py b/plugins/flirt.py index c7389d1..fd610b3 100755 --- a/plugins/flirt.py +++ b/plugins/flirt.py @@ -47,9 +47,16 @@ flirts = ["I bet your name's Mickey, 'cause you're so fine.", @hook.command(autohelp=False) def flirt(inp, nick=None, me=None, input=None): ".flirt -- Make the bot flirt with ." - msg = "flirts with " + nick + "... \"" + random.choice(flirts) + "\"" - if re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()) and inp != "": - msg = "flirts with " + inp + "... \"" + random.choice(flirts) + "\"" + inp = inp.strip() + + if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()): + notice("Invalid username!") + return + + target = nick + if inp.lower() and inp != "": + target = inp if inp == input.conn.nick.lower() or inp == "itself": - msg = "flirts with itself... \"" + random.choice(flirts) + "\"" + target = "itself" + msg = "flirts with " + target + "... \"" + random.choice(flirts) + "\"" me(msg) diff --git a/plugins/kill.py b/plugins/kill.py index 92d9ca3..20e6324 100755 --- a/plugins/kill.py +++ b/plugins/kill.py @@ -42,12 +42,12 @@ def kill(inp, me=None, nick=None, input=None, notice=None): return if inp == input.conn.nick.lower() or inp == "itself": - kill = random.choice(kills) - kill = re.sub ('', nick, kill) - msg = re.sub ('', random.choice(body), kill) + target = random.choice(kills) + target = re.sub ('', nick, target) + target = re.sub ('', random.choice(body), target) else: - kill = random.choice(kills) - kill = re.sub ('', inp, kill) - msg = re.sub ('', random.choice(body), kill) - + target = random.choice(kills) + target = re.sub ('', inp, target) + target = re.sub ('', random.choice(body), target) + msg = target me(msg) diff --git a/plugins/lart.py b/plugins/lart.py index bacd79b..5fa8388 100755 --- a/plugins/lart.py +++ b/plugins/lart.py @@ -119,8 +119,8 @@ def lart(inp, me=None, nick=None, input=None, notice=None): return if inp == input.conn.nick.lower() or inp == "itself": - msg = re.sub ('', nick, random.choice(larts)) + target = nick else: - msg = re.sub ('', inp, random.choice(larts)) - + target = inp + msg = re.sub ('', target, random.choice(larts)) me(msg) diff --git a/plugins/slap.py b/plugins/slap.py index e162f56..8fffd45 100755 --- a/plugins/slap.py +++ b/plugins/slap.py @@ -45,12 +45,8 @@ def slap(inp, me=None, nick=None, input=None, notice=None): return if inp == input.conn.nick.lower() or inp == "itself": - slap = random.choice(slaps) - slap = re.sub ('', nick, slap) - msg = re.sub ('', random.choice(items), slap) + target = re.sub ('', nick, random.choice(slaps)) else: - slap = random.choice(slaps) - slap = re.sub ('', inp, slap) - msg = re.sub ('', random.choice(items), slap) - + target = re.sub ('', inp, random.choice(slaps)) + msg = re.sub ('', random.choice(items), target) me(msg)