--- lib/python2.5/site-packages/supybot/plugins/QuoteGrabs/plugin.py.orig 2007-01-15 19:06:40.000000000 +0200 +++ lib/python2.5/site-packages/supybot/plugins/QuoteGrabs/plugin.py 2007-01-15 19:53:18.000000000 +0200 @@ -221,12 +221,14 @@ s = 'jots down a new quote for %s' % msg.nick irc.reply(s, action=True, prefixNick=False) - def grab(self, irc, msg, args, channel, nick): - """[] + def grab(self, irc, msg, args, channel, nick, idx): + """[] [] Grabs a quote from by for the quotegrabs table. is only necessary if the message isn't sent in the channel itself. + is only necessary if you want to grab an older 's message. + (0 = last, 1 = last but one, 2 = last but two, etc) """ # chan is used to make sure we know where to grab the quote from, as # opposed to channel which is used to determine which db to store the @@ -236,14 +238,19 @@ raise callbacks.ArgumentError if ircutils.nickEqual(nick, msg.nick): irc.error('You can\'t quote grab yourself.', Raise=True) + # let people be lame ;-) + idx = abs(idx) for m in reversed(irc.state.history): if m.command == 'PRIVMSG' and ircutils.nickEqual(m.nick, nick) \ and ircutils.strEqual(m.args[0], chan): + if idx <= 0: self._grab(irc, m, msg.prefix) irc.replySuccess() return + else: + idx -= 1 irc.error('I couldn\'t find a proper message to grab.') - grab = wrap(grab, ['channeldb', 'nick']) + grab = wrap(grab, ['channeldb', 'nick', optional('int', 0)]) def quote(self, irc, msg, args, channel, nick): """[]