Handled case in last where argument isn't an integer.

This commit is contained in:
Jeremy Fincher 2003-06-02 05:57:54 +00:00
parent c31078339b
commit 9bf2b8a624

View File

@ -481,7 +481,11 @@ class FunCommands(callbacks.Privmsg):
if n == '':
n = 1
else:
n = int(n)
try:
n = int(n)
except ValueError:
irc.error(msg, '<message number> must be an integer.')
return
n += 1 # To remove the last question asked.
for msg in reviter(irc.state.history):
if msg.command == 'PRIVMSG' and msg.args[0] == channel and n == 1: