diff --git a/plugins/Seen/plugin.py b/plugins/Seen/plugin.py index 4e3b1d95b..852fe665d 100644 --- a/plugins/Seen/plugin.py +++ b/plugins/Seen/plugin.py @@ -218,6 +218,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 channel not in irc.state.channels.keys(): + irc.error(format('I am not in %s.', channel)) + 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 @@ -234,6 +237,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 channel not in irc.state.channels.keys(): + irc.error(format('I am not in %s.', channel)) + 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 @@ -270,6 +276,9 @@ class Seen(callbacks.Plugin): Returns the last thing said in . is only necessary if the message isn't sent in the channel itself. """ + if channel not in irc.state.channels.keys(): + irc.error(format('I am not in %s.', channel)) + 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 @@ -298,6 +307,9 @@ class Seen(callbacks.Plugin): is only necessary if the message isn't sent in the channel itself. """ + if channel not in irc.state.channels.keys(): + irc.error(format('I am not in %s.', channel)) + 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 @@ -309,6 +321,9 @@ class Seen(callbacks.Plugin): Returns the messages since last left the channel. """ + if channel not in irc.state.channels.keys(): + irc.error(format('I am not in %s.', channel)) + 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