From 8b4dfe46ace6e1e3400dea7191d55468c01a103c Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 14 Dec 2014 11:46:49 -0800 Subject: [PATCH 1/2] Seen: insert a witty message when calling seen/any on the bot --- plugins/Seen/plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/Seen/plugin.py b/plugins/Seen/plugin.py index 6eee89c26..611efbb87 100644 --- a/plugins/Seen/plugin.py +++ b/plugins/Seen/plugin.py @@ -233,6 +233,9 @@ class Seen(callbacks.Plugin): saying. is only necessary if the message isn't sent on the channel itself. may contain * as a wildcard. """ + if ircutils.strEqual(name, irc.nick): + irc.reply(_("You've found me!")) + return if msg.nick not in irc.state.channels[channel].users: irc.error(format('You must be in %s to use this command.', channel)) return @@ -250,6 +253,9 @@ class Seen(callbacks.Plugin): and returns the last time user was active in . is only necessary if the message isn't sent on the channel itself. """ + if ircutils.strEqual(name, irc.nick): + irc.reply(_("You've found me!")) + return if msg.nick not in irc.state.channels[channel].users: irc.error(format('You must be in %s to use this command.', channel)) return From be4c074f8dc98f28570d79f5c13244a67a1f2cb9 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 19 Dec 2014 07:52:28 -0800 Subject: [PATCH 2/2] Seen: fix for tests --- plugins/Seen/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Seen/plugin.py b/plugins/Seen/plugin.py index 611efbb87..55e9c15c5 100644 --- a/plugins/Seen/plugin.py +++ b/plugins/Seen/plugin.py @@ -233,7 +233,7 @@ class Seen(callbacks.Plugin): saying. is only necessary if the message isn't sent on the channel itself. may contain * as a wildcard. """ - if ircutils.strEqual(name, irc.nick): + if name and ircutils.strEqual(name, irc.nick): irc.reply(_("You've found me!")) return if msg.nick not in irc.state.channels[channel].users: @@ -253,7 +253,7 @@ class Seen(callbacks.Plugin): and returns the last time user was active in . is only necessary if the message isn't sent on the channel itself. """ - if ircutils.strEqual(name, irc.nick): + if name and ircutils.strEqual(name, irc.nick): irc.reply(_("You've found me!")) return if msg.nick not in irc.state.channels[channel].users: